├── README.md ├── tempCodeRunnerFile.py ├── zomato.csv ├── pythonReport (1).docx ├── objective02.py ├── objective05.py ├── objective01.py ├── objective03.py └── objective04.py /README.md: -------------------------------------------------------------------------------- 1 | # Zomato-project -------------------------------------------------------------------------------- /tempCodeRunnerFile.py: -------------------------------------------------------------------------------- 1 | df = pd.read_csv("zomato.csv", encoding='ISO-8859-1') 2 | -------------------------------------------------------------------------------- /zomato.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham03Raj/Zomato-project/HEAD/zomato.csv -------------------------------------------------------------------------------- /pythonReport (1).docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shubham03Raj/Zomato-project/HEAD/pythonReport (1).docx -------------------------------------------------------------------------------- /objective02.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | df = pd.read_csv("zomato.csv", encoding='ISO-8859-1') 5 | 6 | city_counts = df['City'].value_counts().head(10) 7 | 8 | plt.figure(figsize=(10, 6)) 9 | city_counts.plot(kind='bar', color='coral') 10 | plt.title('Top 10 Cities with the Most Restaurants') 11 | plt.xlabel('City') 12 | plt.ylabel('Number of Restaurants') 13 | plt.xticks(rotation=45) 14 | plt.grid(axis='y', linestyle='--', alpha=0.7) 15 | plt.tight_layout() 16 | plt.show() 17 | -------------------------------------------------------------------------------- /objective05.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import seaborn as sns 3 | import matplotlib.pyplot as plt 4 | 5 | 6 | df = pd.read_csv("zomato.csv", encoding='ISO-8859-1') 7 | 8 | filtered_df = df[df['Aggregate rating'] > 0] 9 | 10 | sns.set(style="whitegrid") 11 | 12 | plt.figure(figsize=(10, 6)) 13 | sns.countplot( 14 | x='Aggregate rating', 15 | data=filtered_df, 16 | palette='Blues_d', 17 | order=sorted(filtered_df['Aggregate rating'].unique()) 18 | ) 19 | 20 | plt.title('Distribution of Restaurant Ratings', fontsize=16) 21 | plt.xlabel('Aggregate Rating', fontsize=12) 22 | plt.ylabel('Number of Restaurants', fontsize=12) 23 | plt.xticks(rotation=45) 24 | plt.tight_layout() 25 | plt.show() 26 | -------------------------------------------------------------------------------- /objective01.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | df = pd.read_csv("zomato.csv", encoding='ISO-8859-1') 5 | 6 | df = df[['City', 'Average Cost for two']].dropna() 7 | df['Average Cost for two'] = pd.to_numeric(df['Average Cost for two'], errors='coerce') 8 | df = df.dropna() 9 | 10 | city_avg_cost = df.groupby('City')['Average Cost for two'].mean().sort_values(ascending=False).head(10) 11 | 12 | plt.figure(figsize=(10, 6)) 13 | city_avg_cost.plot(kind='barh', color='coral') 14 | plt.title('Top 10 Cities with Highest Average Cost for Two') 15 | plt.xlabel('Average Cost for Two') 16 | plt.ylabel('City') 17 | plt.gca().invert_yaxis() 18 | plt.grid(axis='x', linestyle='--', alpha=0.7) 19 | plt.tight_layout() 20 | plt.show() 21 | -------------------------------------------------------------------------------- /objective03.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | df = pd.read_csv("zomato.csv", encoding='ISO-8859-1') 5 | 6 | df_price_rating = df[['Price range', 'Aggregate rating']].dropna() 7 | 8 | df_price_rating['Price range'] = pd.to_numeric(df_price_rating['Price range'], errors='coerce') 9 | df_price_rating['Aggregate rating'] = pd.to_numeric(df_price_rating['Aggregate rating'], errors='coerce') 10 | 11 | df_price_rating.dropna(inplace=True) 12 | 13 | plt.figure(figsize=(8, 6)) 14 | df_price_rating.boxplot(column='Aggregate rating', by='Price range', grid=False, patch_artist=True, 15 | boxprops=dict(facecolor='skyblue')) 16 | plt.title('Aggregate Rating by Price Range') 17 | plt.suptitle('') 18 | plt.xlabel('Price Range (1 = Low, 4 = High)') 19 | plt.ylabel('Aggregate Rating') 20 | plt.tight_layout() 21 | plt.show() 22 | -------------------------------------------------------------------------------- /objective04.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import matplotlib.pyplot as plt 3 | 4 | df = pd.read_csv("zomato.csv", encoding='ISO-8859-1') 5 | 6 | df_delivery = df[['Has Online delivery', 'Aggregate rating']].dropna() 7 | df_delivery = df_delivery[df_delivery['Has Online delivery'].isin(['Yes', 'No'])] 8 | 9 | df_delivery['Aggregate rating'] = pd.to_numeric(df_delivery['Aggregate rating'], errors='coerce') 10 | df_delivery.dropna(inplace=True) 11 | 12 | rating_by_delivery = df_delivery.groupby('Has Online delivery')['Aggregate rating'].mean() 13 | 14 | plt.figure(figsize=(6, 6)) 15 | plt.pie(rating_by_delivery, 16 | labels=rating_by_delivery.index, 17 | autopct='%1.1f%%', 18 | colors=['lightcoral', 'mediumseagreen'], 19 | startangle=140, 20 | wedgeprops={'edgecolor': 'white'}) 21 | 22 | plt.title('Average Aggregate Rating\nOnline Delivery vs No Online Delivery') 23 | plt.tight_layout() 24 | plt.show() 25 | --------------------------------------------------------------------------------