Created
October 18, 2022 04:58
-
-
Save srang992/2d46ab965466defc317d451c504b5391 to your computer and use it in GitHub Desktop.
This file contains 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
# selecting chain restaurants which have 'Italian', 'Mexican', and 'Chinese' cuisines. | |
italian_chain = chain_data[(chain_data['Cuisine']=='Italian') & (chain_data['Frequency'] > 5)] | |
mexican_chain = chain_data[(chain_data['Cuisine']=='Mexican') & (chain_data['Frequency'] > 5)] | |
chinese_chain = chain_data[(chain_data['Cuisine']=='Chinese') & (chain_data['Frequency'] > 5)] | |
# getting the name of the restaurants where those cuisines mostly available | |
italian_rest = count_df(italian_chain, 'RestaurantName').head(5) | |
mexican_rest = count_df(mexican_chain, 'RestaurantName').head(5) | |
chinese_rest = count_df(chinese_chain, 'RestaurantName').head(5) | |
# defining titles and colors | |
titles = ["Italian Restaurants", "Mexican Restaurants", "Chinese Restaurants"] | |
colors = ['#ff9999','#66b3ff','#99ff99','#ffcc99', '#f4bbff'] | |
# plotting the donut charts | |
fig = multi_donut_charts([italian_rest, mexican_rest, chinese_rest], 1, 3, | |
['RestaurantName','RestaurantName', 'RestaurantName'], colors, titles,) | |
plt.tight_layout() | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment