image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

_data = pd.read_csv('../input/zomato.csv')

data = _data.drop(columns=['url', 'address', 'phone'], axis=1)
columns = data.columns

splist = []
cuisine = []
for i in range(0, data['cuisines'].count()):
    splist = str(data['cuisines'][i]).split(', ')
    for item in splist:
        if item not in cuisine:
            cuisine.append(item)
cuisine

cuisineCount = pd.DataFrame(columns=['cuisines', 'count'])
i = 0
for c in cuisine:
    restaurant = data['cuisines'].str.contains(c, case=False, regex=True, na=False)
    cuisineCount.loc[i] = [c, restaurant[restaurant == True].count()]
    i = i + 1
cuisineCount.sort_values(by='count', axis=0, ascending=False, inplace=True)

import matplotlib.pyplot as plt
import seaborn as sns
plt.figure(1, figsize=(30, 15))
data_CuisineCount = cuisineCount.iloc[0:25, :]
plt.subplot(2, 1, 1)
plt.subplots_adjust(hspace=0.5, wspace=0.5)
plt.bar(data_CuisineCount['cuisines'], data_CuisineCount['count'])
plt.subplot(2, 1, 2)
plt.subplots_adjust(hspace=0.5, wspace=0.5)
plt.pie(x=data_CuisineCount['count'], labels=data_CuisineCount['cuisines'])
plt.show()