text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

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

import seaborn as sns

df = pd.read_csv('../input/zomato-restaurants-data/zomato.csv', encoding='latin-1')

df.columns

df.shape

df.isnull().sum()

[features for features in df.columns if df[features].isnull().sum() > 0]

df_country = pd.read_excel('../input/zomato-restaurants-data/Country-Code.xlsx')
df_country

final_df = pd.merge(df, df_country, on='Country Code', how='left')

final_df.dtypes

final_df.Country.value_counts()

country_names = final_df.Country.value_counts().index

country_val = final_df.Country.value_counts().values

final_df.columns

final_df.groupby(['Aggregate rating', 'Rating color', 'Rating text']).size()

ratings = final_df.groupby(['Aggregate rating', 'Rating color', 'Rating text']).size().reset_index().rename(columns={0: 'Rating Count'})

plt.rcParams['figure.figsize'] = (12, 6)

plt.rcParams['figure.figsize'] = (12, 6)

plt.rcParams['figure.figsize'] = (12, 6)
sns.barplot(x='Aggregate rating', y='Rating Count', hue='Rating color', data=ratings, palette=['blue', 'red', 'orange', 'yellow', 'green', 'green'])