Created
September 20, 2020 14:54
-
-
Save gbarreiro/8ce7f1e0833c76e9394edccbfbc9d018 to your computer and use it in GitHub Desktop.
Best cuisines: insight 3
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
percentages = {} | |
for city, cuisine in city_local_cuisines.items(): | |
# For each city, get the percentage of local cuisine restaurants | |
percentage = cuisines_city_normalized.at[city, cuisine] | |
percentages[city] = percentage | |
# Plot the data in a bar graph | |
df_percentages = pd.Series(percentages).sort_values(ascending=True) | |
df_percentages.plot(kind='barh') | |
plt.xlabel('% of local cuisine restaurants') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment