Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created May 16, 2018 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillKoehrsen/287b7f8fcf5c2b4bab755d79cebcec11 to your computer and use it in GitHub Desktop.
Save WillKoehrsen/287b7f8fcf5c2b4bab755d79cebcec11 to your computer and use it in GitHub Desktop.
# Create a list of buildings with more than 100 measurements
types = data.dropna(subset=['score'])
types = types['Largest Property Use Type'].value_counts()
types = list(types[types.values > 100].index)
# Plot of distribution of scores for building categories
figsize(12, 10)
# Plot each building
for b_type in types:
# Select the building type
subset = data[data['Largest Property Use Type'] == b_type]
# Density plot of Energy Star scores
sns.kdeplot(subset['score'].dropna(),
label = b_type, shade = False, alpha = 0.8);
# label the plot
plt.xlabel('Energy Star Score', size = 20); plt.ylabel('Density', size = 20);
plt.title('Density Plot of Energy Star Scores by Building Type', size = 28);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment