Created
October 19, 2022 03:34
-
-
Save srang992/254b8a8c30fb221685898e43a3146eb6 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 states where those cuisines mostly available | |
italian_rest = count_df(italian_chain, 'State').head(5) | |
mexican_rest = count_df(mexican_chain, 'State').head(5) | |
chinese_rest = count_df(chinese_chain, 'State').head(5) | |
# defining titles and colors | |
titles = ["Italian Restaurants(Independent)", "Mexican Restaurants(Independent)", | |
"Chinese Restaurants(Independent)"] | |
colors = ['#ff9999','#66b3ff','#99ff99','#ffcc99', '#f4bbff'] | |
# plotting the donut charts | |
fig = multi_donut_charts([italian_rest, mexican_rest, chinese_rest], 1, 3, | |
['State','State', 'State'], 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