<jupyter_start><jupyter_text>**Zomato Dataset Exploratory Data Analysis** https://github.com/krishnaik06/5-Days-Live-EDA-and-Feature-Engineering<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline

df=pd.read_csv('/zomato.csv',encoding='latin-1')
df.head()
df.columns
df.info()
df.describe()<jupyter_output><empty_output><jupyter_text>In Data Analysis what all things we do1.   Missing values 2.   Eaplore about the numerical variables 3.   Explore about categorical variables4.   Finding relationship between features<jupyter_code>df.isnull().sum()
[features for features in df.columns if df[features].isnull().sum()>0]
sns.heatmap(df.isnull(),yticklabels=False,cbar=False,cmap='viridis')
df_country=pd.read_excel('/content/Country-Code.xlsx')
df_country.head()
df.columns
final_df=pd.merge(df,df_country,on='Country Code',how='left')
final_df.head(2)
##to check data type
final_df.dtypes
final_df.Country.value_counts()
country_names=final_df.Country.value_counts().index
country_val=final_df.Country.value_counts().values
##pie chart top 3 countries that use zomato
plt.pie(
    country_val[:3],labels=country_names[:3],autopct='%1.2f%%')

#observations:Zomato max records or transcations are in India after that USA and UK
final_df.columns
ratings=final_df.groupby(['Aggregate rating','Rating color','Rating text']).size().reset_index().rename(columns={0:'Rating Count'})
ratings
##observations:
#1. when rating is b/w 4.5 to 4.9---------->Excellent
#2. when rating is b/w 4.0 to 3.4--------->very good
#3. when rating is b/w 3.5 to 3.9---------->good 
#4. when rating is b/w 3.0 to 3.4---------->avg
#5. when rating is b/w 2.5 to 2.9---------->avg
#6. when rating is b/w 2.0 to 2.4---------->poor  

import matplotlib
matplotlib.rcParams['figure.figsize']=(12,6)
sns.barplot(x="Aggregate rating",y="Rating Count",data=ratings)
import matplotlib
matplotlib.rcParams['figure.figsize']=(12,6)
sns.barplot(x="Aggregate rating",y="Rating Count",hue="Rating color",data=ratings,palette=['white','red','orange','yellow','green','green'])
#observations:
#1. not rated count is very high
#2. max number of ratings are between 2.5 to 3.4
#count plot
sns.countplot(x="Rating color",data=ratings,palette=['blue','red','orange','yellow','green','green'])
##find the countries name that as given 0 rating
final_df[final_df['Rating color']=='White'].groupby('Country').size().reset_index()
final_df.groupby(['Aggregate rating','Country']).size().reset_index().head(5)
#observations:max number of 0 ratings are from India customers
##find out which currency is used by which country?
final_df.columns
final_df[['Country','Currency']].groupby(['Country','Currency']).size().reset_index()
##which country as online delavery
final_df[['Country','Has Online delivery']].groupby(['Country','Has Online delivery']).size().reset_index()
#observations
#1. online Deliveries are available in India and UAE
#pie chart for top 5 cities distributions
city_val=final_df.City.value_counts().values
city_labels=final_df.City.value_counts().index
plt.pie(city_val[:5],labels=city_labels[:5],autopct='%1.2f%%')
#find the top 10 cuuisines
final_df.columns
Cuisines_val=final_df.Cuisines.value_counts().values
Cuisines_labels=final_df.Cuisines.value_counts().index
plt.pie(Cuisines_val[:10],labels=Cuisines_labels[:10],autopct='%1.2f%%')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16715542521994134, 'fraction_numerical': 0.021994134897360705, 'mean_word_length': 6.399132321041215, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '584623', 'license': 'MIT', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1164, 'n_words': 261, 'path': 'feature_engineering(EDA).ipynb', 'repo_name': 'GirishHiremath/ML', 'size': '3410'}