Created
October 5, 2019 03:54
-
-
Save taylorplumer/989499353fa08a255eabc3014600931f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a histogram of listings | |
neighbourhood_list = df['neighbourhood_cleansed'].unique().tolist() | |
hist_data = [] | |
for neighbourhood in neighbourhood_list: | |
trace = go.Histogram(x = df.loc[df['neighbourhood_cleansed'] == neighbourhood].price.tolist(), opacity=0.75, name = neighbourhood) | |
hist_data.append(trace) | |
layout = go.Layout(barmode='stack', xaxis = dict(title='Listing Price'), yaxis = dict(title='Count')) | |
fig = go.Figure(data=hist_data, layout=layout) | |
# refer to README.md for dependencies on displaying Plotly Figure in jupyter notebook https://plot.ly/python/static-image-export/ | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment