About Dataset¶
This dataset is a collection of restaurants that are registered on Zomato in Bengaluru City. In this dataset, we have more than 50000 rows and 17 columns, a fairly large dataset. You will be able to get hands-on experience while performing the following tasks and will be able to understand how real-world problem statement analysis is done.
Data Dictionary¶
- URL - url of the restaurant
- Address - complete address of the restaurant
- Name - name of the restaurant
- online_order - Do they accept online order (Yes/No)
- book_table - Can we book table at the restaurant
- rate - Rating given on zomato app
- votes - Number of people gave rating
- phone - Phone Number of the restaurant
- location - Area of the restaurant
- rest_type - Restaurant Type(Casual Dining,Cafe,Quick, ETC...)
Installing dependency¶
👉Ignore It if already installed
1. !pip install numpy
2. !pip install pandas
3. !pip install matplotlib
4. !pip install seaborn
step -1 Data Preprocessing and Cleaning¶
Importing Required library¶
# perform linear operations
import numpy as np
# Data manipulation
import pandas as pd
#Data Visualization
import matplotlib.pyplot as plt
import seaborn as sns
# Remove warnings
import warnings
warnings.filterwarnings('ignore')
#Load the dataset
df=pd.read_csv(r"C:\Users\Lenovo\Documents\jupyter\DataSets\zomato.csv")
# Print top 5 rows
df.head()
url | address | name | online_order | book_table | rate | votes | phone | location | rest_type | dish_liked | cuisines | approx_cost(for two people) | reviews_list | menu_item | listed_in(type) | listed_in(city) | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | https://www.zomato.com/bangalore/jalsa-banasha... | 942, 21st Main Road, 2nd Stage, Banashankari, ... | Jalsa | Yes | Yes | 4.1/5 | 775 | 080 42297555\r\n+91 9743772233 | Banashankari | Casual Dining | Pasta, Lunch Buffet, Masala Papad, Paneer Laja... | North Indian, Mughlai, Chinese | 800 | [('Rated 4.0', 'RATED\n A beautiful place to ... | [] | Buffet | Banashankari |
1 | https://www.zomato.com/bangalore/spice-elephan... | 2nd Floor, 80 Feet Road, Near Big Bazaar, 6th ... | Spice Elephant | Yes | No | 4.1/5 | 787 | 080 41714161 | Banashankari | Casual Dining | Momos, Lunch Buffet, Chocolate Nirvana, Thai G... | Chinese, North Indian, Thai | 800 | [('Rated 4.0', 'RATED\n Had been here for din... | [] | Buffet | Banashankari |
2 | https://www.zomato.com/SanchurroBangalore?cont... | 1112, Next to KIMS Medical College, 17th Cross... | San Churro Cafe | Yes | No | 3.8/5 | 918 | +91 9663487993 | Banashankari | Cafe, Casual Dining | Churros, Cannelloni, Minestrone Soup, Hot Choc... | Cafe, Mexican, Italian | 800 | [('Rated 3.0', "RATED\n Ambience is not that ... | [] | Buffet | Banashankari |
3 | https://www.zomato.com/bangalore/addhuri-udupi... | 1st Floor, Annakuteera, 3rd Stage, Banashankar... | Addhuri Udupi Bhojana | No | No | 3.7/5 | 88 | +91 9620009302 | Banashankari | Quick Bites | Masala Dosa | South Indian, North Indian | 300 | [('Rated 4.0', "RATED\n Great food and proper... | [] | Buffet | Banashankari |
4 | https://www.zomato.com/bangalore/grand-village... | 10, 3rd Floor, Lakshmi Associates, Gandhi Baza... | Grand Village | No | No | 3.8/5 | 166 | +91 8026612447\r\n+91 9901210005 | Basavanagudi | Casual Dining | Panipuri, Gol Gappe | North Indian, Rajasthani | 600 | [('Rated 4.0', 'RATED\n Very good restaurant ... | [] | Buffet | Banashankari |
# check for shape
df.shape
(51717, 17)
From above cell we see that the dataset is quite large it contains 51717 observations and 17 columns
#Check info of each colummn
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 51717 entries, 0 to 51716 Data columns (total 17 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 url 51717 non-null object 1 address 51717 non-null object 2 name 51717 non-null object 3 online_order 51717 non-null object 4 book_table 51717 non-null object 5 rate 43942 non-null object 6 votes 51717 non-null int64 7 phone 50509 non-null object 8 location 51696 non-null object 9 rest_type 51490 non-null object 10 dish_liked 23639 non-null object 11 cuisines 51672 non-null object 12 approx_cost(for two people) 51371 non-null object 13 reviews_list 51717 non-null object 14 menu_item 51717 non-null object 15 listed_in(type) 51717 non-null object 16 listed_in(city) 51717 non-null object dtypes: int64(1), object(16) memory usage: 6.7+ MB
From above cell we see that there are 16 object column and 1 integer
# Checking null values
df.isnull().sum()
url 0 address 0 name 0 online_order 0 book_table 0 rate 7775 votes 0 phone 1208 location 21 rest_type 227 dish_liked 28078 cuisines 45 approx_cost(for two people) 346 reviews_list 0 menu_item 0 listed_in(type) 0 listed_in(city) 0 dtype: int64
From above cell we see that there are missing values in our data in rate
,phone
,location
,rest_type
,dish_liked
,cuisines
,approx_cost(for two people)
columns
# check for duplicate
df.duplicated().sum()
0
From above cell we see that there are no duplicates present in our dataset
df.columns
Index(['url', 'address', 'name', 'online_order', 'book_table', 'rate', 'votes', 'phone', 'location', 'rest_type', 'dish_liked', 'cuisines', 'approx_cost(for two people)', 'reviews_list', 'menu_item', 'listed_in(type)', 'listed_in(city)'], dtype='object')
# Drop columns
df1=df.drop(columns=['url', 'address','phone'])
df1.head()
name | online_order | book_table | rate | votes | location | rest_type | dish_liked | cuisines | approx_cost(for two people) | reviews_list | menu_item | listed_in(type) | listed_in(city) | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Jalsa | Yes | Yes | 4.1/5 | 775 | Banashankari | Casual Dining | Pasta, Lunch Buffet, Masala Papad, Paneer Laja... | North Indian, Mughlai, Chinese | 800 | [('Rated 4.0', 'RATED\n A beautiful place to ... | [] | Buffet | Banashankari |
1 | Spice Elephant | Yes | No | 4.1/5 | 787 | Banashankari | Casual Dining | Momos, Lunch Buffet, Chocolate Nirvana, Thai G... | Chinese, North Indian, Thai | 800 | [('Rated 4.0', 'RATED\n Had been here for din... | [] | Buffet | Banashankari |
2 | San Churro Cafe | Yes | No | 3.8/5 | 918 | Banashankari | Cafe, Casual Dining | Churros, Cannelloni, Minestrone Soup, Hot Choc... | Cafe, Mexican, Italian | 800 | [('Rated 3.0', "RATED\n Ambience is not that ... | [] | Buffet | Banashankari |
3 | Addhuri Udupi Bhojana | No | No | 3.7/5 | 88 | Banashankari | Quick Bites | Masala Dosa | South Indian, North Indian | 300 | [('Rated 4.0', "RATED\n Great food and proper... | [] | Buffet | Banashankari |
4 | Grand Village | No | No | 3.8/5 | 166 | Basavanagudi | Casual Dining | Panipuri, Gol Gappe | North Indian, Rajasthani | 600 | [('Rated 4.0', 'RATED\n Very good restaurant ... | [] | Buffet | Banashankari |
In above cell we remove unnecessary column and create a new dataframe df1
# Rename Columns
df1.rename(columns={'approx_cost(for two people)':'cost','listed_in(type)':'service','listed_in(city)':'city'},inplace=True)
df1
name | online_order | book_table | rate | votes | location | rest_type | dish_liked | cuisines | cost | reviews_list | menu_item | service | city | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Jalsa | Yes | Yes | 4.1/5 | 775 | Banashankari | Casual Dining | Pasta, Lunch Buffet, Masala Papad, Paneer Laja... | North Indian, Mughlai, Chinese | 800 | [('Rated 4.0', 'RATED\n A beautiful place to ... | [] | Buffet | Banashankari |
1 | Spice Elephant | Yes | No | 4.1/5 | 787 | Banashankari | Casual Dining | Momos, Lunch Buffet, Chocolate Nirvana, Thai G... | Chinese, North Indian, Thai | 800 | [('Rated 4.0', 'RATED\n Had been here for din... | [] | Buffet | Banashankari |
2 | San Churro Cafe | Yes | No | 3.8/5 | 918 | Banashankari | Cafe, Casual Dining | Churros, Cannelloni, Minestrone Soup, Hot Choc... | Cafe, Mexican, Italian | 800 | [('Rated 3.0', "RATED\n Ambience is not that ... | [] | Buffet | Banashankari |
3 | Addhuri Udupi Bhojana | No | No | 3.7/5 | 88 | Banashankari | Quick Bites | Masala Dosa | South Indian, North Indian | 300 | [('Rated 4.0', "RATED\n Great food and proper... | [] | Buffet | Banashankari |
4 | Grand Village | No | No | 3.8/5 | 166 | Basavanagudi | Casual Dining | Panipuri, Gol Gappe | North Indian, Rajasthani | 600 | [('Rated 4.0', 'RATED\n Very good restaurant ... | [] | Buffet | Banashankari |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
51712 | Best Brews - Four Points by Sheraton Bengaluru... | No | No | 3.6 /5 | 27 | Whitefield | Bar | NaN | Continental | 1,500 | [('Rated 5.0', "RATED\n Food and service are ... | [] | Pubs and bars | Whitefield |
51713 | Vinod Bar And Restaurant | No | No | NaN | 0 | Whitefield | Bar | NaN | Finger Food | 600 | [] | [] | Pubs and bars | Whitefield |
51714 | Plunge - Sheraton Grand Bengaluru Whitefield H... | No | No | NaN | 0 | Whitefield | Bar | NaN | Finger Food | 2,000 | [] | [] | Pubs and bars | Whitefield |
51715 | Chime - Sheraton Grand Bengaluru Whitefield Ho... | No | Yes | 4.3 /5 | 236 | ITPL Main Road, Whitefield | Bar | Cocktails, Pizza, Buttermilk | Finger Food | 2,500 | [('Rated 4.0', 'RATED\n Nice and friendly pla... | [] | Pubs and bars | Whitefield |
51716 | The Nest - The Den Bengaluru | No | No | 3.4 /5 | 13 | ITPL Main Road, Whitefield | Bar, Casual Dining | NaN | Finger Food, North Indian, Continental | 1,500 | [('Rated 5.0', 'RATED\n Great ambience , look... | [] | Pubs and bars | Whitefield |
51717 rows × 14 columns
In above cell we rename column name for better readability
#Check for null values
df1.isna().sum()
name 0 online_order 0 book_table 0 rate 7775 votes 0 location 21 rest_type 227 dish_liked 28078 cuisines 45 cost 346 reviews_list 0 menu_item 0 service 0 city 0 dtype: int64
Data Cleaning¶
#create a threshold of our data
threshold = len(df1) * 0.05
threshold
2585.8500000000004
In above cell we create a threshold for dropping null values we drop the columns null values whose columns have null less than 5% of our data
cols_to_drop = df1.columns[df1.isna().sum() <= threshold]
cols_to_drop
Index(['name', 'online_order', 'book_table', 'votes', 'location', 'rest_type', 'cuisines', 'cost', 'reviews_list', 'menu_item', 'service', 'city'], dtype='object')
#Dropping null values
df1.dropna(subset=cols_to_drop,inplace=True)
#again check for null values
df1.isna().sum()
name 0 online_order 0 book_table 0 rate 7615 votes 0 location 0 rest_type 0 dish_liked 27713 cuisines 0 cost 0 reviews_list 0 menu_item 0 service 0 city 0 dtype: int64
After removing null values we have two columns that have missing values so we have to fill it let's fill the missing values
Filling missing values in Biryani
Column¶
df1.dish_liked.mode()
df1.dish_liked.fillna('Biryani',inplace=True)
In above cell we fill missing value in dish_liked column, the dish_liked column contain categorical data so we fill the missing value uisng mode
Clean the data of the rate
column¶
df1.rate.unique()
array(['4.1/5', '3.8/5', '3.7/5', '3.6/5', '4.6/5', '4.0/5', '4.2/5', '3.9/5', '3.1/5', '3.0/5', '3.2/5', '3.3/5', '2.8/5', '4.4/5', '4.3/5', 'NEW', '2.9/5', '3.5/5', nan, '2.6/5', '3.8 /5', '3.4/5', '4.5/5', '2.5/5', '2.7/5', '4.7/5', '2.4/5', '2.2/5', '2.3/5', '3.4 /5', '-', '3.6 /5', '4.8/5', '3.9 /5', '4.2 /5', '4.0 /5', '4.1 /5', '3.7 /5', '3.1 /5', '2.9 /5', '3.3 /5', '2.8 /5', '3.5 /5', '2.7 /5', '2.5 /5', '3.2 /5', '2.6 /5', '4.5 /5', '4.3 /5', '4.4 /5', '4.9/5', '2.1/5', '2.0/5', '1.8/5', '4.6 /5', '4.9 /5', '3.0 /5', '4.8 /5', '2.3 /5', '4.7 /5', '2.4 /5', '2.1 /5', '2.2 /5', '2.0 /5', '1.8 /5'], dtype=object)
df1['rate']= df1['rate'].str.strip('-')
df1['rate']= df1['rate'].str.strip('NEW')
df1['rate']= df1['rate'].str.replace('/5','')
df1['rate']= df1['rate'].str.replace(' ','')
df1['rate'].unique()
array(['4.1', '3.8', '3.7', '3.6', '4.6', '4.0', '4.2', '3.9', '3.1', '3.0', '3.2', '3.3', '2.8', '4.4', '4.3', '', '2.9', '3.5', nan, '2.6', '3.4', '4.5', '2.5', '2.7', '4.7', '2.4', '2.2', '2.3', '4.8', '4.9', '2.1', '2.0', '1.8'], dtype=object)
df1.rate=pd.to_numeric(df1.rate)
df1.rate.fillna(df1.rate.mean(),inplace=True)
df1.isna().sum()
name 0 online_order 0 book_table 0 rate 0 votes 0 location 0 rest_type 0 dish_liked 0 cuisines 0 cost 0 reviews_list 0 menu_item 0 service 0 city 0 dtype: int64
df1.info()
<class 'pandas.core.frame.DataFrame'> Int64Index: 51148 entries, 0 to 51716 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 name 51148 non-null object 1 online_order 51148 non-null object 2 book_table 51148 non-null object 3 rate 51148 non-null float64 4 votes 51148 non-null int64 5 location 51148 non-null object 6 rest_type 51148 non-null object 7 dish_liked 51148 non-null object 8 cuisines 51148 non-null object 9 cost 51148 non-null object 10 reviews_list 51148 non-null object 11 menu_item 51148 non-null object 12 service 51148 non-null object 13 city 51148 non-null object dtypes: float64(1), int64(1), object(12) memory usage: 5.9+ MB
Clean the data of the cost
column¶
df1.cost.unique()
array(['800', '300', '600', '700', '550', '500', '450', '650', '400', '900', '200', '750', '150', '850', '100', '1,200', '350', '250', '950', '1,000', '1,500', '1,300', '199', '80', '1,100', '160', '1,600', '230', '130', '50', '190', '1,700', '1,400', '180', '1,350', '2,200', '2,000', '1,800', '1,900', '330', '2,500', '2,100', '3,000', '2,800', '3,400', '40', '1,250', '3,500', '4,000', '2,400', '2,600', '120', '1,450', '469', '70', '3,200', '60', '560', '240', '360', '6,000', '1,050', '2,300', '4,100', '5,000', '3,700', '1,650', '2,700', '4,500', '140'], dtype=object)
df1.cost=df1.cost.str.replace(",","")
df1.cost=df1.cost.astype(int)
df1.cost.unique()
array([ 800, 300, 600, 700, 550, 500, 450, 650, 400, 900, 200, 750, 150, 850, 100, 1200, 350, 250, 950, 1000, 1500, 1300, 199, 80, 1100, 160, 1600, 230, 130, 50, 190, 1700, 1400, 180, 1350, 2200, 2000, 1800, 1900, 330, 2500, 2100, 3000, 2800, 3400, 40, 1250, 3500, 4000, 2400, 2600, 120, 1450, 469, 70, 3200, 60, 560, 240, 360, 6000, 1050, 2300, 4100, 5000, 3700, 1650, 2700, 4500, 140])
df1.cost.dtype
dtype('int32')
df1.votes=pd.to_numeric(df1.votes)
df1.votes
0 775 1 787 2 918 3 88 4 166 ... 51712 27 51713 0 51714 0 51715 236 51716 13 Name: votes, Length: 51148, dtype: int64
Step -2 Data analysis¶
df1
name | online_order | book_table | rate | votes | location | rest_type | dish_liked | cuisines | cost | reviews_list | menu_item | service | city | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Jalsa | Yes | Yes | 4.100000 | 775 | Banashankari | Casual Dining | Pasta, Lunch Buffet, Masala Papad, Paneer Laja... | North Indian, Mughlai, Chinese | 800 | [('Rated 4.0', 'RATED\n A beautiful place to ... | [] | Buffet | Banashankari |
1 | Spice Elephant | Yes | No | 4.100000 | 787 | Banashankari | Casual Dining | Momos, Lunch Buffet, Chocolate Nirvana, Thai G... | Chinese, North Indian, Thai | 800 | [('Rated 4.0', 'RATED\n Had been here for din... | [] | Buffet | Banashankari |
2 | San Churro Cafe | Yes | No | 3.800000 | 918 | Banashankari | Cafe, Casual Dining | Churros, Cannelloni, Minestrone Soup, Hot Choc... | Cafe, Mexican, Italian | 800 | [('Rated 3.0', "RATED\n Ambience is not that ... | [] | Buffet | Banashankari |
3 | Addhuri Udupi Bhojana | No | No | 3.700000 | 88 | Banashankari | Quick Bites | Masala Dosa | South Indian, North Indian | 300 | [('Rated 4.0', "RATED\n Great food and proper... | [] | Buffet | Banashankari |
4 | Grand Village | No | No | 3.800000 | 166 | Basavanagudi | Casual Dining | Panipuri, Gol Gappe | North Indian, Rajasthani | 600 | [('Rated 4.0', 'RATED\n Very good restaurant ... | [] | Buffet | Banashankari |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
51712 | Best Brews - Four Points by Sheraton Bengaluru... | No | No | 3.600000 | 27 | Whitefield | Bar | Biryani | Continental | 1500 | [('Rated 5.0', "RATED\n Food and service are ... | [] | Pubs and bars | Whitefield |
51713 | Vinod Bar And Restaurant | No | No | 3.702011 | 0 | Whitefield | Bar | Biryani | Finger Food | 600 | [] | [] | Pubs and bars | Whitefield |
51714 | Plunge - Sheraton Grand Bengaluru Whitefield H... | No | No | 3.702011 | 0 | Whitefield | Bar | Biryani | Finger Food | 2000 | [] | [] | Pubs and bars | Whitefield |
51715 | Chime - Sheraton Grand Bengaluru Whitefield Ho... | No | Yes | 4.300000 | 236 | ITPL Main Road, Whitefield | Bar | Cocktails, Pizza, Buttermilk | Finger Food | 2500 | [('Rated 4.0', 'RATED\n Nice and friendly pla... | [] | Pubs and bars | Whitefield |
51716 | The Nest - The Den Bengaluru | No | No | 3.400000 | 13 | ITPL Main Road, Whitefield | Bar, Casual Dining | Biryani | Finger Food, North Indian, Continental | 1500 | [('Rated 5.0', 'RATED\n Great ambience , look... | [] | Pubs and bars | Whitefield |
51148 rows × 14 columns
Q1 Restaurants delivering Online or not¶
x = df1["online_order"].value_counts()
y = x.index
plt.pie(x=x, labels=y,colors = ['lightcoral', 'lightskyblue'], autopct='%.0f%%',explode = (0, 0.1),shadow=True)
plt.title("Online order Percentage",color="black");
From above pie plot we can see that according to our data 59%
restaurant allow online delivery while 41%
restaurant not allowed online delivery
Q2 Restaurants allowing table booking or not¶
x = df1["book_table"].value_counts()
y = x.index
plt.pie(x=x, labels=y,colors = ['#99ff99', '#ffcc99'], autopct='%.0f%%',explode = (0, 0.1),shadow=True)
plt.title("Table Booking ratio",color="black");
From above pie plot we observe that 87%
restaurant in bangalore not allowed table booking online while 13%
restaurant allowed table booking online
Q3 Table booking Rate vs Rate¶
sns.set_style('darkgrid')
sns.barplot(data=df1,x='book_table',y='rate')
plt.show()
The bar plot above indicates that restaurants allowing online table bookings tend to receive higher ratings compared to those that do not offer this service.
Q4 Best Location¶
df1.location.unique()
array(['Banashankari', 'Basavanagudi', 'Mysore Road', 'Jayanagar', 'Kumaraswamy Layout', 'Rajarajeshwari Nagar', 'Vijay Nagar', 'Uttarahalli', 'JP Nagar', 'South Bangalore', 'City Market', 'Nagarbhavi', 'Bannerghatta Road', 'BTM', 'Kanakapura Road', 'Bommanahalli', 'CV Raman Nagar', 'Electronic City', 'HSR', 'Marathahalli', 'Wilson Garden', 'Shanti Nagar', 'Koramangala 5th Block', 'Koramangala 8th Block', 'Richmond Road', 'Koramangala 7th Block', 'Jalahalli', 'Koramangala 4th Block', 'Bellandur', 'Sarjapur Road', 'Whitefield', 'East Bangalore', 'Old Airport Road', 'Indiranagar', 'Koramangala 1st Block', 'Frazer Town', 'RT Nagar', 'MG Road', 'Brigade Road', 'Lavelle Road', 'Church Street', 'Ulsoor', 'Residency Road', 'Shivajinagar', 'Infantry Road', 'St. Marks Road', 'Cunningham Road', 'Race Course Road', 'Commercial Street', 'Vasanth Nagar', 'HBR Layout', 'Domlur', 'Ejipura', 'Jeevan Bhima Nagar', 'Old Madras Road', 'Malleshwaram', 'Seshadripuram', 'Kammanahalli', 'Koramangala 6th Block', 'Majestic', 'Langford Town', 'Central Bangalore', 'Sanjay Nagar', 'Brookefield', 'ITPL Main Road, Whitefield', 'Varthur Main Road, Whitefield', 'KR Puram', 'Koramangala 2nd Block', 'Koramangala 3rd Block', 'Koramangala', 'Hosur Road', 'Rajajinagar', 'Banaswadi', 'North Bangalore', 'Nagawara', 'Hennur', 'Kalyan Nagar', 'New BEL Road', 'Jakkur', 'Rammurthy Nagar', 'Thippasandra', 'Kaggadasapura', 'Hebbal', 'Kengeri', 'Sankey Road', 'Sadashiv Nagar', 'Basaveshwara Nagar', 'Yeshwantpur', 'West Bangalore', 'Magadi Road', 'Yelahanka', 'Sahakara Nagar', 'Peenya'], dtype=object)
x=df1.groupby('location')[['rate','votes']].mean()
x.sort_values(by=['rate','votes'],ascending=False)
x=x.head(10)
l=x.index.to_list()
x
rate | votes | |
---|---|---|
location | ||
BTM | 3.602110 | 113.204102 |
Banashankari | 3.659095 | 179.617257 |
Banaswadi | 3.552800 | 54.131783 |
Bannerghatta Road | 3.555788 | 133.463066 |
Basavanagudi | 3.675116 | 138.770468 |
Basaveshwara Nagar | 3.664752 | 95.962567 |
Bellandur | 3.568176 | 161.537372 |
Bommanahalli | 3.390191 | 32.639831 |
Brigade Road | 3.704790 | 352.725780 |
Brookefield | 3.617267 | 181.344512 |
sns.barplot(x=x.index,y=x.rate,data=x,palette='magma')
plt.xticks(rotation=90)
plt.title("Best location by rating")
plt.show()
above bar plot show us best location by rating according to our data one of the best location is BTM
and second one is Banashankari
and so on...
sns.barplot(x=x.index,y=x.votes,data=x,palette='viridis')
plt.xticks(rotation=90)
plt.title("Best location by votes")
plt.show()
The bar plot above displays the locations with the highest number of votes for restaurants. According to our data, Brigade Road
is the best location, followed by Brookfield
and others in descending order.
Q5 Relation between Location and Rating¶
plt.figure(figsize=(15, 6))
sns.scatterplot(x=df1.location,y=df1.rate)
plt.xticks(rotation=90)
plt.show()