Swiggy Data Analysis

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

iNeuron Internship Project : Swiggy Data Analysis

Author : Lokesh Attarde

Libraries -
In [1]: import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
import plotly.express as px

import warnings
warnings.filterwarnings(action = 'ignore')

Reading Data
In [2]: df_Swiggy = pd.read_csv('Swiggy Bangalore Outlet Details.csv', sep = ',')
df_Swiggy

Out[2]:
Shop_Name Cuisine Location Rating Cost_for_Two

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 ₹ 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 ₹ 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 ₹ 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 ₹ 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 ₹ 450

... ... ... ... ... ...

113 Wok Paper Scissors Pan-Asian, Chinese, Asian JNC Road, Koramangala 3.9 ₹ 219

114 Savoury Restaurant Arabian, Middle Eastern, North Indian, Grill, ... Madiwala, BTM 4.1 ₹ 600

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 ₹ 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 ₹ 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 ₹ 400

118 rows × 5 columns

In [3]: df_Swiggy.columns

Out[3]: Index(['Shop_Name', 'Cuisine', 'Location', 'Rating', 'Cost_for_Two'], dtype='object')

In [4]: df_Swiggy.isnull().sum()

Out[4]: Shop_Name 0
Cuisine 0
Location 0
Rating 0
Cost_for_Two 0
dtype: int64

In [5]: df_Swiggy.describe()

Out[5]:
Shop_Name Cuisine Location Rating Cost_for_Two

count 118 118 118 118 118

unique 115 79 65 13 30

top La Pino'z Pizza North Indian BTM, BTM 4.1 ₹ 300

freq 2 12 13 30 16

In [6]: df_Swiggy.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 118 entries, 0 to 117
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Shop_Name 118 non-null object
1 Cuisine 118 non-null object
2 Location 118 non-null object
3 Rating 118 non-null object
4 Cost_for_Two 118 non-null object
dtypes: object(5)
memory usage: 4.7+ KB

Data Pre-processing & Cleaning -


In [7]: df_Swiggy.duplicated().sum()

Out[7]: 0

In [8]: df_Swiggy.head()

Out[8]:
Shop_Name Cuisine Location Rating Cost_for_Two

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 ₹ 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 ₹ 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 ₹ 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 ₹ 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 ₹ 450

In [9]: df_Swiggy['Rating'].unique()

Out[9]: array(['4.3', '4.4', '4.1', '4.2', '3.9', '3.8', '4', '3.7', '3.6', '4.8',
'4.5', '4.6', '--'], dtype=object)

In [10]: df_Swiggy['Rating'] = df_Swiggy['Rating'].str.replace('--', '0').astype(float)

In [11]: df_Swiggy['Rating'].unique()

Out[11]: array([4.3, 4.4, 4.1, 4.2, 3.9, 3.8, 4. , 3.7, 3.6, 4.8, 4.5, 4.6, 0. ])

In [12]: df_Swiggy['Cost_for_Two'].unique()

Out[12]: array(['₹ 150', '₹ 400', '₹ 126', '₹ 450', '₹ 350', '₹ 200', '₹ 500',
'₹ 247', '₹ 550', '₹ 300', '₹ 129', '₹ 250', '₹ 268', '₹ 600',
'₹ 527', '₹ 130', '₹ 257', '₹ 280', '₹ 399', '₹ 220', '₹ 800',
'₹ 100', '₹ 178', '₹ 120', '₹ 251', '₹ 650', '₹ 132', '₹ 153',
'₹ 219', '₹ 193'], dtype=object)

In [13]: def data_processing(string):


cost = string.split(' ')[1]
return cost

In [14]: df_Swiggy['Cost_for_Two'] = df_Swiggy['Cost_for_Two'].apply(data_processing)

In [15]: df_Swiggy['Cost_for_Two'] = df_Swiggy['Cost_for_Two'].astype('int')

In [16]: df_Swiggy['Cost_for_Two'].unique()

Out[16]: array([150, 400, 126, 450, 350, 200, 500, 247, 550, 300, 129, 250, 268,
600, 527, 130, 257, 280, 399, 220, 800, 100, 178, 120, 251, 650,
132, 153, 219, 193])

In [17]: df_Swiggy.rename(columns = {'Cost_for_Two' : 'Cost_for_Two (₹)'}, inplace = True)

In [18]: df_Swiggy

Out[18]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

... ... ... ... ... ...

113 Wok Paper Scissors Pan-Asian, Chinese, Asian JNC Road, Koramangala 3.9 219

114 Savoury Restaurant Arabian, Middle Eastern, North Indian, Grill, ... Madiwala, BTM 4.1 600

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 400

118 rows × 5 columns

In [19]: df_Swiggy.dtypes

Out[19]: Shop_Name object


Cuisine object
Location object
Rating float64
Cost_for_Two (₹) int32
dtype: object

In [20]: df_Swiggy.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 118 entries, 0 to 117
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Shop_Name 118 non-null object
1 Cuisine 118 non-null object
2 Location 118 non-null object
3 Rating 118 non-null float64
4 Cost_for_Two (₹) 118 non-null int32
dtypes: float64(1), int32(1), object(3)
memory usage: 4.3+ KB

In [21]: df_Swiggy.describe()

Out[21]:
Rating Cost_for_Two (₹)

count 118.000000 118.000000

mean 4.061864 321.008475

std 0.430845 137.286804

min 0.000000 100.000000

25% 4.000000 204.750000

50% 4.100000 300.000000

75% 4.300000 400.000000

max 4.800000 800.000000

In [22]: df_Swiggy.head()

Out[22]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

In [23]: ##Distribution of 'Ratings':


df_valid_Ratings = df_Swiggy[df_Swiggy['Rating'] > 0]
df_valid_Ratings

Out[23]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

... ... ... ... ... ...

113 Wok Paper Scissors Pan-Asian, Chinese, Asian JNC Road, Koramangala 3.9 219

114 Savoury Restaurant Arabian, Middle Eastern, North Indian, Grill, ... Madiwala, BTM 4.1 600

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 400

117 rows × 5 columns

In [24]: #Distribution of 'Rating':


sns.distplot(df_valid_Ratings['Rating'])

Out[24]: <AxesSubplot:xlabel='Rating', ylabel='Density'>

Conclusion:

From this Distribution Plot, We can conclude that More that '50%' of Restaurants are having a Rating greater than "4.1" with a Maximum Rating of
"4.8" which is considered as a decent Rating.
And It also means that, Most of these Restaurants are doing very well & Rated accordingly by the Customers.

In [25]: df_Swiggy['Location'].unique()

Out[25]: array(['Koramangala, Koramangala', 'Sector 5, HSR',


'6th Block, Koramangala', 'HSR, HSR', '5th Block, Koramangala',
'Koramangala 4th Block, Koramangala', 'BTM 2nd Stage, BTM',
'BTM, BTM', '9th Main road, Koramangala', 'outer ring road, BTM',
'7th Block, Koramangala', '1st MAin, Koramangala',
'Bommanahalli, BTM', '6th block, Koramangala', 'Sector 4, HSR',
'BTM 1st stage, BTM', 'Jakkasandra Extn, Koramangala',
'Marutinagar Main Road, BTM', '1st Block, Koramangala',
'4th Cross, BTM', 'koramangala, Koramangala', 'BTM 2nd stage, BTM',
'3rd main, BTM', 'HSR 1st sector, HSR', 'Sector 7, HSR',
'3rd Sector, HSR', 'Chocolate Factory Road, BTM',
'16th Main Road, 2nd Stage, BTM', '1st Stage, BTM',
'Hosur Main Road, Koramangala',
'1st Cross Road, 5th Block, Near Jyothi Nivas College, Koramangala',
'Mico Layout, BTM', '4th Cross, Koramangala',
'4th Block, Koramangala', 'Intermediate Ring Road, Koramangala',
'3rd sector, HSR', '8TH BLOCK, Koramangala',
'4th b cross, Koramangala', 'SG palaya, BTM',
"Venkatapura Main Rd, Teacher's Colony, Jakkasandra, HSR",
'KHB Colony, Koramangala', 'Sector 3, HSR',
'Bannerghatta Road, Jayanagar',
'80 Feet Peripheral Road, Koramangala', 'Btm, BTM',
'Near Wipro Park Signal, Koramangala', '16th Main Road, BTM',
'2nd Stage, BTM', 'Kuvempu Nagar, Stage 2, BTM',
'Koramangala 1st block, Koramangala',
'5th Block Kormangala, Koramangala', 'Koramangla, Koramangala',
'5th block, Koramangala', '9th Main Rd, Sector 6, HSR Layout, HSR',
'Jay Bheema Nagar, BTM', 'Koramangala 6th block, Koramangala',
'Maruthi Nagar, BTM', 'Sector 6, HSR',
'Jakkasandra Village, Koramangala', '4th block, Koramangala',
'Madiwala Junction, BTM', 'kormangala, Koramangala',
'JNC Road, Koramangala', 'Madiwala, BTM',
'5th block Koramangala, Koramangala'], dtype=object)

In [26]: df_Swiggy['Location'].nunique()

Out[26]: 65

In [27]: swiggy_Koramangala = df_Swiggy[df_Swiggy['Location'].str.contains(r'Koramangala')]


swiggy_Koramangala

Out[27]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

5 Kitchens of Punjab North Indian Koramangala 4th Block, Koramangala 4.2 350

9 Yumlane Pizza Pizzas, Italian, Mexican 9th Main road, Koramangala 3.8 150

... ... ... ... ... ...

112 Kritunga Andhra, Biryani 5th Block, Koramangala 3.9 500

113 Wok Paper Scissors Pan-Asian, Chinese, Asian JNC Road, Koramangala 3.9 219

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 400

64 rows × 5 columns

In [28]: swiggy_HSR = df_Swiggy[df_Swiggy['Location'].str.contains(r'HSR')]


swiggy_HSR

Out[28]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

8 Hotel Manu South Indian, Kerala, Chinese, North Indian HSR, HSR 4.1 350

19 Shree Khana Khazana Indian, Rajasthani Sector 4, HSR 4.1 350

24 New Udupi Grand Chinese, Jain, North Indian, South Indian HSR, HSR 4.3 150

36 Biriyani Zone North Indian, Chinese, Biryani HSR 1st sector, HSR 4.1 600

37 Gongura's North Indian, Chinese, Biryani Sector 7, HSR 3.8 300

39 Leon Grill Turkish, Portuguese, American 3rd Sector, HSR 4.3 300

41 Cakewala Desserts HSR, HSR 4.3 450

57 Donne Biriyani House South Indian 3rd sector, HSR 4.0 300

58 Nanda's Andhra, Biryani HSR, HSR 4.0 400

61 Cake Garden Desserts, Bakery HSR, HSR 3.9 250

71 Nizams Biryani Biryani, Juices, Kebabs Venkatapura Main Rd, Teacher's Colony, Jakkasa... 3.6 200

73 Punjabi Rasoi North Indian Sector 3, HSR 4.0 800

98 Mandya Gowdru Donne Biryani Biryani HSR, HSR 0.0 350

99 Dindigul Thalapakatti Biriyani North Indian HSR, HSR 4.1 650

101 Easy Bites Snacks, American 9th Main Rd, Sector 6, HSR Layout, HSR 3.8 200

107 Junior Kuppanna Chettinad, South Indian Sector 6, HSR 4.0 550

In [29]: swiggy_HSR.shape

Out[29]: (18, 5)

In [30]: swiggy_BTM = df_Swiggy[df_Swiggy['Location'].str.contains(r'BTM')]


swiggy_BTM

Out[30]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

6 99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food... Fast Food, North Indian, Chinese BTM 2nd Stage, BTM 4.1 200

7 La Pino'z Pizza Italian BTM, BTM 3.9 500

10 Ambur Star Briyani Chinese, South Indian, North Indian, Desserts,... outer ring road, BTM 4.1 500

17 Sri Lakshmi Dhaba North Indian Bommanahalli, BTM 3.7 200

20 Just Bake - Cakes & confectioners Desserts, Bakery BTM 1st stage, BTM 4.3 300

22 Hotel Godavari North Indian, Chinese, Hyderabadi Marutinagar Main Road, BTM 4.0 400

25 Swad Punjab da Indian BTM, BTM 4.1 250

27 High N Hungry Andhra, Biryani, Chinese, Desserts, Fast Food,... 4th Cross, BTM 4.1 350

31 Bengali Fun Foods North Indian BTM 2nd stage, BTM 4.2 300

33 Oottupura Kerala, South Indian BTM, BTM 4.3 268

35 Hyderabadi Biryani Hub North Indian, Chinese, Biryani 3rd main, BTM 3.9 450

40 Venu's Donne Biryani Biryani Chocolate Factory Road, BTM 4.3 300

42 Swadista Aahar South Indian, Snacks, North Indian, Chinese 16th Main Road, 2nd Stage, BTM 4.1 250

44 Svadu Pure Ghee Sweets Desserts, Fast Food, Sweets, Chaat 1st Stage, BTM 4.1 200

45 Sai Abhiruchi Chinese, South Indian, Andhra, Hyderabadi BTM, BTM 3.7 250

49 Balaji's Veg North Indian, Chinese, South Indian Mico Layout, BTM 4.1 300

51 Donne Biryani Mandi Biryani, Andhra, South Indian BTM, BTM 4.0 150

60 calicut cafe restaurant Fast Food, Beverages BTM, BTM 4.1 280

65 World of asia Beverages, Chinese BTM, BTM 4.0 250

66 Ghar Ka Khana North Indian BTM, BTM 4.2 220

68 KANNUR FOOD POINT Kerala, Chinese SG palaya, BTM 3.9 300

69 KANNOOR RESTAURANT North Indian, Chinese BTM, BTM 4.0 250

70 Fattoush Arabian, Beverages, Biryani, Chinese, Desserts... BTM, BTM 3.9 400

76 BIRIYANI TASTE MASTH(BTM) North Indian, South Indian Btm, BTM 4.2 300

79 Tandoori Merchant Andhra, Biryani, Chinese, Desserts, Fast Food,... 4th Cross, BTM 4.2 100

80 Chinese Bae Chinese, Thai BTM, BTM 4.5 450

83 Abhiruchi Hotel Chinese, Hyderabadi, Biryani, Indian, South In... BTM, BTM 4.0 250

84 Punjabi Swag Punjabi, North Indian, Chinese, Fast Food, Hea... 16th Main Road, BTM 3.7 400

86 Gyaani Da Punjabi Dhaba North Indian 2nd Stage, BTM 4.0 500

87 Biriyani Bhatti Biryani, Hyderabadi, Andhra, North Indian, Sou... Kuvempu Nagar, Stage 2, BTM 4.1 350

92 BIRYANI CRAFTS Indian BTM, BTM 4.1 500

104 R.B Food Point Chinese, North Indian Jay Bheema Nagar, BTM 3.7 350

106 New Tasty Cafeteria Andhra, Chettinad, Chinese, Mughlai, North Indian Maruthi Nagar, BTM 4.0 350

110 Biryani Pot North Indian, Biryani Madiwala Junction, BTM 4.0 500

114 Savoury Restaurant Arabian, Middle Eastern, North Indian, Grill, ... Madiwala, BTM 4.1 600

In [31]: swiggy_BTM.shape

Out[31]: (35, 5)

As we can see the Returants are given from only 3 Locations.

Area-wise Analysis -

BTM Area

In [32]: sns.histplot(swiggy_BTM['Rating'], bins = 10)

Out[32]: <AxesSubplot:xlabel='Rating', ylabel='Count'>

In [33]: sns.histplot(swiggy_BTM['Cost_for_Two (₹)'], bins = 10)

Out[33]: <AxesSubplot:xlabel='Cost_for_Two (₹)', ylabel='Count'>

HSR Area

In [34]: sns.countplot(swiggy_HSR['Rating'])

Out[34]: <AxesSubplot:xlabel='Rating', ylabel='count'>

In [35]: sns.histplot(swiggy_HSR['Cost_for_Two (₹)'], bins = 10)

Out[35]: <AxesSubplot:xlabel='Cost_for_Two (₹)', ylabel='Count'>

Koramangala Area

In [36]: sns.histplot(swiggy_Koramangala['Rating'], bins = 10)

Out[36]: <AxesSubplot:xlabel='Rating', ylabel='Count'>

In [37]: sns.histplot(swiggy_Koramangala['Cost_for_Two (₹)'], bins = 15)

Out[37]: <AxesSubplot:xlabel='Cost_for_Two (₹)', ylabel='Count'>

Conclusion: As we can see that the Area-wise Rating & Cost for Two varies as following:

1. BTM : Most has 4.0 to 4.2 Rating and Approx. Cost for Two People lies between 200 to 350. (Max. Cost goes upto 600)
2. HSR : Most has 4 or above Rating and Approx. Cost for Two People lies between 300 to 400. (Max. Cost goes upto 800)
3. Koramangala : Most has 4.0 to 4.3 Rating and Approx. Cost for Two People lies between 200 to 350. (Max. Cost goes upto 600)

With this we can conclude the Most Costly Area is HSR.

In [38]: df_Swiggy.head()

Out[38]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

In [39]: #Q. Analyse "Approx Cost of 2 People" vs "Rating". Find out the relationship between them.
df_Highest_Rated_Restaurants = df_Swiggy[df_Swiggy['Rating'] >= 4.0]
df_Highest_Rated_Restaurants

Out[39]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

... ... ... ... ... ...

111 Bowl 99 North Indian, South Indian kormangala, Koramangala 4.4 200

114 Savoury Restaurant Arabian, Middle Eastern, North Indian, Grill, ... Madiwala, BTM 4.1 600

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 400

92 rows × 5 columns

In [40]: df_Highest_Rated_Restaurants = df_Highest_Rated_Restaurants.loc[:, ['Shop_Name', 'Rating', 'Cost_for_Two (₹)']]


df_Highest_Rated_Restaurants

Out[40]:
Shop_Name Rating Cost_for_Two (₹)

0 Kanti Sweets 4.3 150

1 Mumbai Tiffin 4.4 400

2 Sri Krishna sagar 4.1 126

3 Al Daaz 4.4 400

4 Beijing Bites 4.1 450

... ... ... ...

111 Bowl 99 4.4 200

114 Savoury Restaurant 4.1 600

115 Royal Treat 4.2 193

116 Thali 99 4.3 200

117 Mani's Dum Biryani 4.2 400

92 rows × 3 columns

In [41]: df_Highest_Rated_Restaurants = df_Highest_Rated_Restaurants.groupby(['Shop_Name', 'Rating'])['Cost_for_Two (₹)'].agg


('mean')
df_Highest_Rated_Restaurants = df_Highest_Rated_Restaurants.reset_index()
df_Highest_Rated_Restaurants

Out[41]:
Shop_Name Rating Cost_for_Two (₹)

0 99 VARIETY DOSA AND JUICE-Malli mane food court 4.1 100.0

1 99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food... 4.1 200.0

2 A2B - Adyar Ananda Bhavan 4.2 450.0

3 Abhiruchi Hotel 4.0 250.0

4 Al Daaz 4.4 400.0

... ... ... ...

86 Venu's Donne Biryani 4.3 300.0

87 WarmOven Cake & Desserts 4.1 200.0

88 World of asia 4.0 250.0

89 XO Belgian Waffle 4.3 250.0

90 calicut cafe restaurant 4.1 280.0

91 rows × 3 columns

In [43]: fig = px.scatter(x = df_Highest_Rated_Restaurants['Cost_for_Two (₹)'],


y = df_Highest_Rated_Restaurants['Rating'],
color = df_Highest_Rated_Restaurants['Rating'],
size = df_Highest_Rated_Restaurants['Cost_for_Two (₹)'],
labels = {'x' : 'Approx. Cost_for_Two (₹)', 'y' : 'Rating', 'color' : 'Rating_Indicator'})
fig.update_layout(template = 'plotly_dark', title = "Analyse 'Approx Cost of 2 People' vs 'Rating'")
fig.show()

Analyse 'Approx Cost of 2 People' vs 'Rating'

Rating_Indicator
4.8 4.8

4.7
4.7

4.6
4.6

4.5
4.5
Rating

4.4
4.4

4.3
4.3
4.2
4.2
4.1
4.1
4

4
100 200 300 400 500 600 700 800

Approx. Cost_for_Two (₹)

Conclusion:

From this 'Scatter Plot', We can clearly say that - Bigger the Bubble, Higher the Price is... Similarly, Smaller the Bubble, Lesser the Price is...
Furthermore, We can also say that, Most of the Affordable/Budgeted Restaurants are having Excellant Rating as well.
Same we can see, For Approx. Cost of "200", "150", "250", and "450", the Ratings were "4.8", "4.6", and "4.5" respectively.
This might be because Most of the people prefer Affordable/Budget-Restaurants which also provides good quality of Cuisines.
and On the other hand, There are few Expensive Restaurants who doesn't have that much Rating and they are Expensive.
Restaurants which Costs around "600" to "800" for Two People are having the Ratings in between '4.0' to '4.1' which is too less as compared to
Affordable/Budgeted Restaurants.
So, That's a Conclusion we can drawn from this 'Scatter Plot'.

In [44]: ##Q. Analyze Affordable/Budgeted and Highest Rated Restaurants of Bangalore:


df_Affordable_Restaurants = df_Swiggy[(df_Swiggy['Cost_for_Two (₹)'] <= 500) & (df_Swiggy['Rating'] >= 4.0)]
df_Affordable_Restaurants

Out[44]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

... ... ... ... ... ...

110 Biryani Pot North Indian, Biryani Madiwala Junction, BTM 4.0 500

111 Bowl 99 North Indian, South Indian kormangala, Koramangala 4.4 200

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 400

82 rows × 5 columns

In [45]: df_Affordable_Restaurants = df_Affordable_Restaurants.groupby(['Shop_Name', 'Rating'])['Cost_for_Two (₹)'].agg('mea


n')
df_Affordable_Restaurants = df_Affordable_Restaurants.reset_index()
df_Affordable_Restaurants

Out[45]:
Shop_Name Rating Cost_for_Two (₹)

0 99 VARIETY DOSA AND JUICE-Malli mane food court 4.1 100.0

1 99 VARIETY DOSA AND PAV BHAJI- Malli Mane Food... 4.1 200.0

2 A2B - Adyar Ananda Bhavan 4.2 450.0

3 Abhiruchi Hotel 4.0 250.0

4 Al Daaz 4.4 400.0

... ... ... ...

76 Venu's Donne Biryani 4.3 300.0

77 WarmOven Cake & Desserts 4.1 200.0

78 World of asia 4.0 250.0

79 XO Belgian Waffle 4.3 250.0

80 calicut cafe restaurant 4.1 280.0

81 rows × 3 columns

In [46]: df_Affordable_Restaurants.sort_values(by = ['Rating'], ascending = False, inplace = True)


df_Affordable_Restaurants

Out[46]:
Shop_Name Rating Cost_for_Two (₹)

41 Khichdi Experiment 4.8 200.0

54 Natural Ice Cream 4.6 150.0

21 Corner House Ice Cream 4.6 250.0

20 Chinese Bae 4.5 450.0

50 Mumbai Tiffin 4.4 400.0

... ... ... ...

55 New Tasty Cafeteria 4.0 350.0

53 Nandhana Palace 4.0 500.0

52 Nanda's 4.0 400.0

45 Maa Di Hatti 4.0 129.0

29 Gyaani Da Punjabi Dhaba 4.0 500.0

81 rows × 3 columns

In [47]: plt.figure(figsize = (18, 7))


sns.barplot(x = df_Affordable_Restaurants['Shop_Name'], y = df_Affordable_Restaurants['Cost_for_Two (₹)'],
data = df_Affordable_Restaurants)
plt.title('Affordable/Budgeted and Highest Rated Restaurants (Bangalore)', fontsize = 14, fontweight = 'bold',
fontstyle = 'italic')
plt.xlabel('Shop_Name', fontsize = 10, fontweight = 'bold')
plt.xlabel('Approx. Cost_for_Two (₹)', fontsize = 10, fontweight = 'bold')
plt.xticks(rotation = 90)
plt.show()

In [48]: #Q. Top 15 Cheapest & Highest Rated Restaurants with Approx. Cost for 2 People:
df_Cheapest_Restaurants = df_Affordable_Restaurants.sort_values(by = 'Cost_for_Two (₹)', ascending = True)
df_Cheapest_Restaurants

Out[48]:
Shop_Name Rating Cost_for_Two (₹)

72 Tandoori Merchant 4.2 100.0

0 99 VARIETY DOSA AND JUICE-Malli mane food court 4.1 100.0

51 NIC Natural Ice Creams 4.2 120.0

68 Sri Krishna sagar 4.1 126.0

45 Maa Di Hatti 4.0 129.0

... ... ... ...

5 Ambur Star Briyani 4.1 500.0

7 BIRYANI CRAFTS 4.1 500.0

53 Nandhana Palace 4.0 500.0

46 Madeena Hotel 4.1 500.0

29 Gyaani Da Punjabi Dhaba 4.0 500.0

81 rows × 3 columns

In [49]: fig = px.bar(data_frame = df_Cheapest_Restaurants,


x = df_Cheapest_Restaurants['Shop_Name'][0:15],
y = df_Cheapest_Restaurants['Cost_for_Two (₹)'][0:15],
color = df_Cheapest_Restaurants['Rating'][0:15],
labels = {'x' : 'Restaurant_Name', 'y' : 'Approx. Cost_for_Two (₹)', 'color' : 'Rating'})
fig.update_layout(template = 'plotly_dark',
title = 'Top 15 Cheapest & Highest Rated Restaurants with Approx. Cost for 2 People')
fig.show()

Top 15 Cheapest & Highest Rated Restaurants with Approx. Cost for 2 People

Rating
4.6
150
Approx. Cost_for_Two (₹)

4.5

4.4
100
4.3

4.2
50
4.1

4
0
Ta 99 NI Sr Ma Do De Ne Ka Ma Sh Na Do Ho Kh
n do VA C iK aD nn lhi w nti du aw tur nne tel aw
ori RI Na ris iH eB Fo Ud Sw rai arm al Sa aK
Me ET tur hn att iry o up ee Idl Ice Bir vit arp
YD a l Ic as an dP iG ts yS aI Cr ya ha
rch ag i iH oin ran nc ea ni Fa o
an OS eC ar t ho Ma
t AA rea ou d p m nd mi
ms se i ly
ND Re
JU s tau
I CE ran
-M t
all
im
an
ef
oo
dc
ou
rt

Restaurant_Name

In [50]: #Q. Top 15 Expensive & Highest Rated Restaurants with Approx. Cost for 2 People:
df_Expensive_Restaurants = df_Highest_Rated_Restaurants.sort_values(by = 'Cost_for_Two (₹)', ascending = False)
df_Expensive_Restaurants

Out[50]:
Shop_Name Rating Cost_for_Two (₹)

67 Punjabi Rasoi 4.0 800.0

26 Dindigul Thalapakatti Biriyani 4.1 650.0

73 Savoury Restaurant 4.1 600.0

81 Taco Bell 4.3 600.0

66 Pizza Hut 4.0 600.0

... ... ... ...

49 Maa Di Hatti 4.0 129.0

77 Sri Krishna sagar 4.1 126.0

56 NIC Natural Ice Creams 4.2 120.0

82 Tandoori Merchant 4.2 100.0

0 99 VARIETY DOSA AND JUICE-Malli mane food court 4.1 100.0

91 rows × 3 columns

In [51]: fig = px.bar(data_frame = df_Expensive_Restaurants,


x = df_Expensive_Restaurants['Shop_Name'][0:15],
y = df_Expensive_Restaurants['Cost_for_Two (₹)'][0:15],
color = df_Expensive_Restaurants['Rating'][0:15],
labels = {'x' : 'Restaurant_Name', 'y' : 'Approx. Cost_for_Two (₹)', 'color' : 'Rating'})
fig.update_layout(template = 'plotly_dark',
title = 'Top 15 Expensive & Highest Rated Restaurants with Approx. Cost for 2 People')
fig.show()

Top 15 Expensive & Highest Rated Restaurants with Approx. Cost for 2 People

800 Rating
4.4

700
4.35
Approx. Cost_for_Two (₹)

600
4.3

500 4.25

400 4.2

300 4.15

200 4.1

4.05
100

4
0
Pu Din Sa Ta Piz Bir Na Ju Me Ch Ma BIR Am Gy Bir
nja d v ou c oB z aH iya ga nio g ha in d ee YA bu aa ya
bi igu ry n rju rK aP NI rS ni ni
Ra lT Re ell ut iZ na up na ea na tar Da Po
so ha on pa Fo rl Ho CR Pu t
i lap sta e nn od tel AF Br
ak ura a s TS iya nja
att nt ni bi
iB Dh
iriy ab
an a
i

Restaurant_Name

Cuisine Analysis:
In [52]: df_Swiggy['Cuisine'] = df_Swiggy['Cuisine'].str.title()
df_Swiggy['Cuisine']

Out[52]: 0 Sweets
1 North Indian, Home Food, Thalis, Combo
2 South Indian, North Indian, Fast Food, Beverag...
3 American, Arabian, Chinese, Desserts, Fast Foo...
4 Chinese, Thai
...
113 Pan-Asian, Chinese, Asian
114 Arabian, Middle Eastern, North Indian, Grill, ...
115 North Indian, Chinese, Seafood, Biryani
116 North Indian
117 Andhra, Biryani
Name: Cuisine, Length: 118, dtype: object

In [53]: df_Swiggy['Cuisine'].unique()

Out[53]: array(['Sweets', 'North Indian, Home Food, Thalis, Combo',


'South Indian, North Indian, Fast Food, Beverages, Jain',
'American, Arabian, Chinese, Desserts, Fast Food, Mughlai, North Indian',
'Chinese, Thai', 'North Indian',
'Fast Food, North Indian, Chinese', 'Italian',
'South Indian, Kerala, Chinese, North Indian',
'Pizzas, Italian, Mexican',
'Chinese, South Indian, North Indian, Desserts, Fast Food, Kerala, Andhra, Beverages, Mughlai, Seafood',
'Desserts', 'Chinese, Andhra, Biryani, Seafood', 'Chinese',
'South Indian, Chinese, Desserts, North Indian',
'Arabian, Fast Food', 'Desserts, Beverages', 'Indian, Rajasthani',
'Desserts, Bakery', 'Chinese, Healthy Food, North Indian',
'North Indian, Chinese, Hyderabadi', 'Fast Food',
'Chinese, Jain, North Indian, South Indian', 'Indian',
'North Indian, South Indian, Chinese',
'Andhra, Biryani, Chinese, Desserts, Fast Food, Seafood, South Indian',
'American, Fast Food',
'Biryani, Seafood, North Indian, Chinese, Desserts, Andhra, South Indian',
'Snacks, American', 'South Indian', 'Kerala, South Indian',
'Mexican', 'North Indian, Chinese, Biryani',
'Turkish, Portuguese, American', 'Biryani',
'South Indian, Snacks, North Indian, Chinese',
'Desserts, Fast Food, Sweets, Chaat',
'Chinese, South Indian, Andhra, Hyderabadi', 'Pizzas, Fast Food',
'Biryani, Mughlai, South Indian', 'Chinese, Asian',
'North Indian, Chinese, South Indian', 'Italian, Desserts, Pizzas',
'Biryani, Andhra, South Indian',
'Chinese, Continental, Italian, Mediterranean, Thai, Lebanese, American, Asian, Beverages, Bakery, Biryani, Ca
fe, Desserts, Healthy Food, Mexican, North Indian, Salads, Pizzas',
'Pizzas, Chinese, Pastas, Salads, American, Continental',
'Andhra, Biryani',
'Chinese, South Indian, North Indian, Fast Food',
'Fast Food, Beverages',
'Biryani, South Indian, North Indian, Fast Food, Andhra, Beverages, Mughlai, Seafood, Punjabi, Hyderabadi, Chi
nese',
'Beverages, Chinese',
'South Indian, Biryani, Kerala, North Indian, Chinese',
'Kerala, Chinese', 'North Indian, Chinese',
'Arabian, Beverages, Biryani, Chinese, Desserts, North Indian',
'Biryani, Juices, Kebabs', 'Andhra, South Indian',
'Beverages, Cafe, Snacks', 'North Indian, South Indian',
'Turkish, Portuguese, American, Grill',
'Home Food, Healthy Food, Indian', 'Ice Cream',
'Chinese, Hyderabadi, Biryani, Indian, South Indian, Andhra, Tandoor',
'Punjabi, North Indian, Chinese, Fast Food, Healthy Food, Mughlai, Desserts',
'American',
'Biryani, Hyderabadi, Andhra, North Indian, South Indian',
'Fast Food, Juices, North Indian',
'North Indian, Chaat, Snacks, Fast Food',
'Desserts, Mughlai, Seafood', 'Ice Cream, Desserts',
'Chinese, North Indian', 'Biryani, Kebabs',
'Andhra, Chettinad, Chinese, Mughlai, North Indian',
'Chettinad, South Indian',
'Continental, Indian, Pan-Asian, Oriental',
'North Indian, Biryani', 'Pan-Asian, Chinese, Asian',
'Arabian, Middle Eastern, North Indian, Grill, Seafood, Kerala, Chinese',
'North Indian, Chinese, Seafood, Biryani'], dtype=object)

In [54]: freq_dict = {}
for i in df_Swiggy['Cuisine'].unique():
Cuisines_Lists = i.split(',')
for Cuisine in Cuisines_Lists:
Cuisine = Cuisine.lstrip(' ')
if Cuisine in freq_dict:
freq_dict[Cuisine] = freq_dict[Cuisine] + 1
else:
freq_dict[Cuisine] = 1

print(freq_dict)
print()
print('Total Records: \t', len(freq_dict))

{'Sweets': 2, 'North Indian': 32, 'Home Food': 2, 'Thalis': 1, 'Combo': 1, 'South Indian': 23, 'Fast Food': 16, 'Beve
rages': 9, 'Jain': 2, 'American': 8, 'Arabian': 4, 'Chinese': 35, 'Desserts': 15, 'Mughlai': 7, 'Thai': 2, 'Italian':
4, 'Kerala': 6, 'Pizzas': 5, 'Mexican': 3, 'Andhra': 12, 'Seafood': 8, 'Biryani': 18, 'Indian': 5, 'Rajasthani': 1,
'Bakery': 2, 'Healthy Food': 4, 'Hyderabadi': 5, 'Snacks': 4, 'Turkish': 2, 'Portuguese': 2, 'Chaat': 2, 'Asian': 3,
'Continental': 3, 'Mediterranean': 1, 'Lebanese': 1, 'Cafe': 2, 'Salads': 2, 'Pastas': 1, 'Punjabi': 2, 'Juices': 2,
'Kebabs': 2, 'Grill': 2, 'Ice Cream': 2, 'Tandoor': 1, 'Chettinad': 2, 'Pan-Asian': 2, 'Oriental': 1, 'Middle Easter
n': 1}

Total Records: 48

Here you can see the different types of cusine present and the number of shops sell them

In [55]: freq_dict.items()

Out[55]: dict_items([('Sweets', 2), ('North Indian', 32), ('Home Food', 2), ('Thalis', 1), ('Combo', 1), ('South Indian', 23),
('Fast Food', 16), ('Beverages', 9), ('Jain', 2), ('American', 8), ('Arabian', 4), ('Chinese', 35), ('Desserts', 15),
('Mughlai', 7), ('Thai', 2), ('Italian', 4), ('Kerala', 6), ('Pizzas', 5), ('Mexican', 3), ('Andhra', 12), ('Seafoo
d', 8), ('Biryani', 18), ('Indian', 5), ('Rajasthani', 1), ('Bakery', 2), ('Healthy Food', 4), ('Hyderabadi', 5), ('S
nacks', 4), ('Turkish', 2), ('Portuguese', 2), ('Chaat', 2), ('Asian', 3), ('Continental', 3), ('Mediterranean', 1),
('Lebanese', 1), ('Cafe', 2), ('Salads', 2), ('Pastas', 1), ('Punjabi', 2), ('Juices', 2), ('Kebabs', 2), ('Grill',
2), ('Ice Cream', 2), ('Tandoor', 1), ('Chettinad', 2), ('Pan-Asian', 2), ('Oriental', 1), ('Middle Eastern', 1)])

In [56]: Cuisine = freq_dict.keys()


freq = freq_dict.values()

In [57]: df_Cuisine_Analysis = pd.DataFrame()

In [58]: df_Cuisine_Analysis['Cuisine'] = Cuisine


df_Cuisine_Analysis['Count'] = freq

In [59]: df_Cuisine_Analysis

Out[59]:
Cuisine Count

0 Sweets 2

1 North Indian 32

2 Home Food 2

3 Thalis 1

4 Combo 1

5 South Indian 23

6 Fast Food 16

7 Beverages 9

8 Jain 2

9 American 8

10 Arabian 4

11 Chinese 35

12 Desserts 15

13 Mughlai 7

14 Thai 2

15 Italian 4

16 Kerala 6

17 Pizzas 5

18 Mexican 3

19 Andhra 12

20 Seafood 8

21 Biryani 18

22 Indian 5

23 Rajasthani 1

24 Bakery 2

25 Healthy Food 4

26 Hyderabadi 5

27 Snacks 4

28 Turkish 2

29 Portuguese 2

30 Chaat 2

31 Asian 3

32 Continental 3

33 Mediterranean 1

34 Lebanese 1

35 Cafe 2

36 Salads 2

37 Pastas 1

38 Punjabi 2

39 Juices 2

40 Kebabs 2

41 Grill 2

42 Ice Cream 2

43 Tandoor 1

44 Chettinad 2

45 Pan-Asian 2

46 Oriental 1

47 Middle Eastern 1

In [60]: plt.figure(figsize = (20, 8))


sns.barplot(x = df_Cuisine_Analysis['Cuisine'],
y = df_Cuisine_Analysis['Count'],
data = df_Cuisine_Analysis)
plt.xticks(rotation = 90)
plt.title('Cuisines Overall Analysis (Bangalore)', fontsize = 14, fontweight = 'bold', fontstyle = 'italic')
plt.xlabel('Cuisine', fontsize = 11, fontweight = 'bold')
plt.ylabel('Number of Restaurants', fontsize = 11, fontweight = 'bold')
plt.show()

In [61]: fig = px.pie(data_frame = df_Cuisine_Analysis,


names = df_Cuisine_Analysis['Cuisine'],
values = df_Cuisine_Analysis['Count'],
title = 'Overall Distribution of Cuisines in Bangalore Restaurants')
fig.update_traces(textposition = 'inside', textinfo = 'percent+label')
fig.show()

Overall Distribution of Cuisines in Bangalore Restaurants

Chinese
North Indian
North Indian Chinese tern
South Indian
11.8%
Eas al
dle 68% ent
Mid 0.3 Ori 68% r

12.9%
0.3 doo
Tan 68%
0.3 tas
Pas 68%

Biryani
0.3 se
ane
Leb 8% an
0.36 ane
iterr 8% ani

So
Med 0.36 asth
Raj 8%
bo
0.36
Com 8%
0.36 lis
Tha 8%

uth
0.36
ian
n-As
Pa 35% d
0.7 ina
Fast Food
8.4 Indi
ett
Ch 35%
0.7 eam
Cr
Ice 35%

6% an Desserts
0.7 ll
Gri
35%
0.7
abs
Keb
0.735%
es
Juic

Andhra
5%
0.73
Punjabi
0.735%
s
Salad
%
0.735

Beverages
Cafe

Biryani
0.735%
Chaat
0.735%
Portuguese

6.62% American
0.735%
Turkish
0.735%
Bakery
0.735%

Seafood
Thai
0.735%
Jain
0.735%

d
Foo
Home Food

Mughlai
0.735%

Fast %
Swee
ts
0.735
Co ntinent
%

1.1% al

5.88 Asian
1.1
Mex %
Kerala
ica

ts
1.1% n
Sn
Pizzas
er He ck a
alt 1.47 s
ss % h
1.4 y Fo
%

De .51 Indian
7% od
Ita
1 lia
5 Ar .47 n
1.4 abia
%
Hyderabadi
4.4 dhra

Hy 1.8 dian

7% n
d 4% er
3.31 ges
1%

ab

Arabian
ad
An

In 4%
%

i
n
era

1.8 as
Piz 4%
America

Seafood

Mughl
2.94%

1.8
Kera
2.94%

Italian
2.57%

2.21

z
Bev

la
%

Healthy Food
ai

Conclusion:

From the above Visualizations, We can say, Most of the Resturants sell "Chinese" which is around '12.9%' followed by "North Indian" & "South
Indian" Cuisines which are around '11.8%' & '8.46%'.
So, We can also infer that Most of the people are fond of these Cusines.

Area-wise Analysis:

BTM Area

In [62]: swiggy_BTM['Cuisine'].unique()

Out[62]: array(['Fast Food, North Indian, Chinese', 'Italian',


'Chinese, South Indian, North Indian, Desserts, Fast Food, Kerala, Andhra, Beverages, Mughlai, Seafood',
'North Indian', 'Desserts, Bakery',
'North Indian, Chinese, Hyderabadi', 'Indian',
'Andhra, Biryani, Chinese, Desserts, Fast Food, Seafood, South Indian',
'Kerala, South Indian', 'North Indian, Chinese, Biryani',
'Biryani', 'South Indian, Snacks, North Indian, Chinese',
'Desserts, Fast Food, Sweets, Chaat',
'Chinese, South Indian, Andhra, Hyderabadi',
'North Indian, Chinese, South Indian',
'Biryani, Andhra, South Indian', 'Fast Food, Beverages',
'Beverages, Chinese', 'Kerala, Chinese', 'North Indian, Chinese',
'Arabian, Beverages, Biryani, Chinese, Desserts, North Indian',
'North Indian, South Indian', 'Chinese, Thai',
'Chinese, Hyderabadi, Biryani, Indian, South Indian, Andhra, Tandoor',
'Punjabi, North Indian, Chinese, Fast Food, Healthy Food, Mughlai, Desserts',
'Biryani, Hyderabadi, Andhra, North Indian, South Indian',
'Chinese, North Indian',
'Andhra, Chettinad, Chinese, Mughlai, North Indian',
'North Indian, Biryani',
'Arabian, Middle Eastern, North Indian, Grill, Seafood, Kerala, Chinese'],
dtype=object)

In [63]: freq_BTM = {}
for i in swiggy_BTM['Cuisine'].unique():
Cuisine_List = i.split(',')
for Cuisine in Cuisine_List:
Cuisine = Cuisine.lstrip()
if Cuisine in freq_BTM:
freq_BTM[Cuisine] = freq_BTM[Cuisine] + 1
else:
freq_BTM[Cuisine] = 1

print(freq_BTM)
print()
print(len(freq_BTM))

{'Fast Food': 6, 'North Indian': 16, 'Chinese': 18, 'Italian': 1, 'South Indian': 10, 'Desserts': 6, 'Kerala': 4, 'An
dhra': 7, 'Beverages': 4, 'Mughlai': 3, 'Seafood': 3, 'Bakery': 1, 'Hyderabadi': 4, 'Indian': 2, 'Biryani': 8, 'Snack
s': 1, 'Sweets': 1, 'Chaat': 1, 'Arabian': 2, 'Thai': 1, 'Tandoor': 1, 'Punjabi': 1, 'Healthy Food': 1, 'Chettinad':
1, 'Middle Eastern': 1, 'Grill': 1}

26

In [64]: freq_BTM.items()

Out[64]: dict_items([('Fast Food', 6), ('North Indian', 16), ('Chinese', 18), ('Italian', 1), ('South Indian', 10), ('Dessert
s', 6), ('Kerala', 4), ('Andhra', 7), ('Beverages', 4), ('Mughlai', 3), ('Seafood', 3), ('Bakery', 1), ('Hyderabadi',
4), ('Indian', 2), ('Biryani', 8), ('Snacks', 1), ('Sweets', 1), ('Chaat', 1), ('Arabian', 2), ('Thai', 1), ('Tandoo
r', 1), ('Punjabi', 1), ('Healthy Food', 1), ('Chettinad', 1), ('Middle Eastern', 1), ('Grill', 1)])

In [65]: Cuisine = freq_BTM.keys()


freq = freq_BTM.values()

In [66]: dict_BTM = {
'Cuisine' : Cuisine,
'Count' : freq
}

df_Cuisine_BTM = pd.DataFrame(dict_BTM)
df_Cuisine_BTM.head()

Out[66]:
Cuisine Count

0 Fast Food 6

1 North Indian 16

2 Chinese 18

3 Italian 1

4 South Indian 10

In [67]: plt.figure(figsize = (20, 8))


sns.barplot(x = df_Cuisine_BTM['Cuisine'],
y = df_Cuisine_BTM['Count'],
data = df_Cuisine_BTM)

plt.xticks(rotation = 90)

plt.title('Cuisines Analysis - BTM (Bangalore)', fontsize = 14, fontweight = 'bold', fontstyle = 'italic')
plt.xlabel('Cuisine', fontsize = 11, fontweight = 'bold')
plt.ylabel('Number of Restaurants', fontsize = 11, fontweight = 'bold')

plt.show()

In [68]: fig = px.pie(data_frame = df_Cuisine_BTM,


names = df_Cuisine_BTM['Cuisine'],
values = df_Cuisine_BTM['Count'],
title = 'Distribution of Cuisines in BTM Bangalore Restaurants')

fig.update_traces(textposition = 'inside', textinfo = 'percent+label')


fig.show()

Distribution of Cuisines in BTM Bangalore Restaurants

Chinese
North Indian
South Indian
North Indian
Chinese Biryani
15.2%
17.1%
Gril
l Andhra
0. 952%
rn

Fast Food
ste
le Ea
Midd 52%
0.9 inad
Chett %

South Indian Hea


lthy
0.952

0.952%
Food

Desserts
Punjabi
9.52% 0.952%
Tandoor
0.952%
Thai
Kerala
0.952%

Beverages
Chaat
0.952%
Sweets
0.952%

Hyderabadi
Snacks
0.952%

Biryani
Bakery
0.952%

Mughlai
Italian
0.952%

7.62% Arabi
an
1.9%
Ind Seafood
ia
Se 1.9 n
a %
Indian
Andhra 2. food
M 86% Arabian
u
6.67% 2. ghl
Hy 3.81
5.7 Food

86 ai
Italian
de %

%
Bev 1%
1%

ra
Desserts

ba

Bakery
st

5.71%

3.8
era
Fa

di
Kerala
3.81%

Snacks
ges

Sweets

Conclusion:

From the above Visualizations, We can say, In BTM Area, Most of the Resturants sell "Chinese" which is around '17.1%' followed by "North Indian" &
"South Indian" Cuisines which are around '15.2%' & '9.52%'.
So, We can also infer that Most of the people are fond of these Cusines.

HSR Area

In [69]: swiggy_HSR['Cuisine'].unique()

Out[69]: array(['North Indian, Home Food, Thalis, Combo',


'American, Arabian, Chinese, Desserts, Fast Food, Mughlai, North Indian',
'South Indian, Kerala, Chinese, North Indian',
'Indian, Rajasthani', 'Chinese, Jain, North Indian, South Indian',
'North Indian, Chinese, Biryani', 'Turkish, Portuguese, American',
'Desserts', 'South Indian', 'Andhra, Biryani', 'Desserts, Bakery',
'Biryani, Juices, Kebabs', 'North Indian', 'Biryani',
'Snacks, American', 'Chettinad, South Indian'], dtype=object)

In [70]: freq_HSR = {}
for i in swiggy_HSR['Cuisine'].unique():
Cuisine_List = i.split(',')
for Cuisine in Cuisine_List:
Cuisine = Cuisine.lstrip()
if Cuisine in freq_HSR:
freq_HSR[Cuisine] = freq_HSR[Cuisine] + 1
else:
freq_HSR[Cuisine] = 1

print(freq_HSR)
print()
print(len(freq_HSR))

{'North Indian': 6, 'Home Food': 1, 'Thalis': 1, 'Combo': 1, 'American': 3, 'Arabian': 1, 'Chinese': 4, 'Desserts':
3, 'Fast Food': 1, 'Mughlai': 1, 'South Indian': 4, 'Kerala': 1, 'Indian': 1, 'Rajasthani': 1, 'Jain': 1, 'Biryani':
4, 'Turkish': 1, 'Portuguese': 1, 'Andhra': 1, 'Bakery': 1, 'Juices': 1, 'Kebabs': 1, 'Snacks': 1, 'Chettinad': 1}

24

In [71]: freq_HSR.items()

Out[71]: dict_items([('North Indian', 6), ('Home Food', 1), ('Thalis', 1), ('Combo', 1), ('American', 3), ('Arabian', 1), ('Ch
inese', 4), ('Desserts', 3), ('Fast Food', 1), ('Mughlai', 1), ('South Indian', 4), ('Kerala', 1), ('Indian', 1), ('R
ajasthani', 1), ('Jain', 1), ('Biryani', 4), ('Turkish', 1), ('Portuguese', 1), ('Andhra', 1), ('Bakery', 1), ('Juice
s', 1), ('Kebabs', 1), ('Snacks', 1), ('Chettinad', 1)])

In [72]: Cuisine = freq_HSR.keys()


freq = freq_HSR.values()

In [73]: dict_HSR = {
'Cuisine' : Cuisine,
'Count' : freq
}

df_Cuisine_HSR = pd.DataFrame(dict_HSR)
df_Cuisine_HSR.head()

Out[73]:
Cuisine Count

0 North Indian 6

1 Home Food 1

2 Thalis 1

3 Combo 1

4 American 3

In [74]: plt.figure(figsize = (20, 8))


sns.barplot(x = df_Cuisine_HSR['Cuisine'],
y = df_Cuisine_HSR['Count'],
data = df_Cuisine_HSR)

plt.xticks(rotation = 90)

plt.title('Cuisines Analysis - HSR (Bangalore)', fontsize = 14, fontweight = 'bold', fontstyle = 'italic')
plt.xlabel('Cuisine', fontsize = 11, fontweight = 'bold')
plt.ylabel('Number of Restaurants', fontsize = 11, fontweight = 'bold')

plt.show()

In [75]: fig = px.pie(data_frame = df_Cuisine_HSR,


names = df_Cuisine_HSR['Cuisine'],
values = df_Cuisine_HSR['Count'],
title = 'Distribution of Cuisines in HSR Bangalore Restaurants')

fig.update_traces(textposition = 'inside', textinfo = 'percent+label')


fig.show()

Distribution of Cuisines in HSR Bangalore Restaurants

North Indian
Chinese Chinese
9.52% North Indian South Indian
14.3% d Biryani
South Indian ina
ett
Ch .38% American
9.52% 2 s
n ack
S 8%
2.3 Desserts
abs
Keb
2 8
.3 % Home Food
Juices
Thalis
Biryani 2.38%
9.52% Bakery Combo
2.38%
Andhra Arabian
2.38%
Portu
gues
Fast Food
2.38 e
American Turk
% Mughlai
7.14% 2.3 ish Kerala
8%
Ja
Ra 2. in
ja 38% Indian
2 st
Desserts .3 ha
8% n
i Rajasthani
7.14%
In 8%
dia
2. rala

Jain
2.3 ood

Ke 8%
3
n
2.3 lai
Mu %
Fast Fo
eF
8%

2.3

Turkish
2.38%
Arabian

gh
Hom

Thalis

Combo
2.38%

2.38%
2.38%

8
od

Portuguese

Conclusion:

From the above Visualizations, We can say, In HSR Area, "North Indian" Cuisines are dominated by around '14.3%' followed by "Chinese" & "South
Indian" Cuisines '9.52%' & '9.52%' Restaurants respectively.
So, We can also infer that - In HSR Area, We may have more "North Indian" people staying there.

Koramangala Area

In [76]: swiggy_Koramangala['Cuisine'].unique()

Out[76]: array(['Sweets', 'South Indian, North Indian, Fast Food, Beverages, Jain',
'Chinese, Thai', 'North Indian', 'Pizzas, Italian, Mexican',
'Desserts', 'Chinese, Andhra, Biryani, Seafood', 'Chinese',
'South Indian, Chinese, Desserts, North Indian',
'Arabian, Fast Food', 'Desserts, Beverages',
'Chinese, Healthy Food, North Indian', 'Fast Food',
'North Indian, South Indian, Chinese', 'American, Fast Food',
'Biryani, Seafood, North Indian, Chinese, Desserts, Andhra, South Indian',
'Snacks, American', 'South Indian', 'Mexican', 'Pizzas, Fast Food',
'Biryani, Mughlai, South Indian', 'Chinese, Asian',
'Italian, Desserts, Pizzas',
'Chinese, Continental, Italian, Mediterranean, Thai, Lebanese, American, Asian, Beverages, Bakery, Biryani, Ca
fe, Desserts, Healthy Food, Mexican, North Indian, Salads, Pizzas',
'Biryani',
'Pizzas, Chinese, Pastas, Salads, American, Continental',
'Chinese, South Indian, North Indian, Fast Food',
'Biryani, South Indian, North Indian, Fast Food, Andhra, Beverages, Mughlai, Seafood, Punjabi, Hyderabadi, Chi
nese',
'South Indian, Biryani, Kerala, North Indian, Chinese',
'Andhra, South Indian', 'Beverages, Cafe, Snacks',
'Turkish, Portuguese, American, Grill',
'Home Food, Healthy Food, Indian', 'Ice Cream', 'American',
'Fast Food, Juices, North Indian',
'North Indian, Chaat, Snacks, Fast Food',
'Desserts, Mughlai, Seafood', 'Ice Cream, Desserts', 'Italian',
'Biryani, Kebabs', 'Continental, Indian, Pan-Asian, Oriental',
'North Indian, South Indian', 'Andhra, Biryani',
'Pan-Asian, Chinese, Asian',
'North Indian, Chinese, Seafood, Biryani'], dtype=object)

In [77]: freq_Koramangala = {}
for i in swiggy_Koramangala['Cuisine'].unique():
Cuisine_List = i.split(',')
for Cuisine in Cuisine_List:
Cuisine = Cuisine.lstrip()
if Cuisine in freq_Koramangala:
freq_Koramangala[Cuisine] = freq_Koramangala[Cuisine] + 1
else:
freq_Koramangala[Cuisine] = 1

print(freq_Koramangala)
print()
print(len(freq_Koramangala))

{'Sweets': 1, 'South Indian': 11, 'North Indian': 14, 'Fast Food': 9, 'Beverages': 5, 'Jain': 1, 'Chinese': 15, 'Tha
i': 2, 'Pizzas': 5, 'Italian': 4, 'Mexican': 3, 'Desserts': 8, 'Andhra': 5, 'Biryani': 10, 'Seafood': 5, 'Arabian':
1, 'Healthy Food': 3, 'American': 6, 'Snacks': 3, 'Mughlai': 3, 'Asian': 3, 'Continental': 3, 'Mediterranean': 1, 'Le
banese': 1, 'Bakery': 1, 'Cafe': 2, 'Salads': 2, 'Pastas': 1, 'Punjabi': 1, 'Hyderabadi': 1, 'Kerala': 1, 'Turkish':
1, 'Portuguese': 1, 'Grill': 1, 'Home Food': 1, 'Indian': 2, 'Ice Cream': 2, 'Juices': 1, 'Chaat': 1, 'Kebabs': 1, 'P
an-Asian': 2, 'Oriental': 1}

42

In [78]: Cuisine = freq_Koramangala.keys()


freq = freq_Koramangala.values()

In [79]: dict_Koramangala = {
'Cuisine' : Cuisine,
'Count' : freq
}

df_Cuisine_Koramangala = pd.DataFrame(dict_Koramangala)
df_Cuisine_Koramangala.head()

Out[79]:
Cuisine Count

0 Sweets 1

1 South Indian 11

2 North Indian 14

3 Fast Food 9

4 Beverages 5

In [80]: plt.figure(figsize = (20, 8))


sns.barplot(x = df_Cuisine_Koramangala['Cuisine'],
y = df_Cuisine_Koramangala['Count'],
data = df_Cuisine_Koramangala)

plt.xticks(rotation = 90)

plt.title('Cuisines Analysis - Koramangala (Bangalore)', fontsize = 14, fontweight = 'bold', fontstyle = 'italic')
plt.xlabel('Cuisine', fontsize = 11, fontweight = 'bold')
plt.ylabel('Number of Restaurants', fontsize = 11, fontweight = 'bold')

plt.show()

In [81]: fig = px.pie(data_frame = df_Cuisine_Koramangala,


names = df_Cuisine_Koramangala['Cuisine'],
values = df_Cuisine_Koramangala['Count'],
title = 'Distribution of Cuisines in Koramangala Bangalore Restaurants')

fig.update_traces(textposition = 'inside', textinfo = 'percent+label')


fig.show()

Distribution of Cuisines in Koramangala Bangalore Restaurants

Chinese
North Indian North Indian
Chinese
Ke 69% al
0. nt
Orie

0. babs
%

South Indian
69

9.66%
0. haat
%

10.3%
C
69

ices

So Ju 69%
0.
Fo
e %
od
l

ut
Hom 0.69 Gril %

Biryani
69
0. ese

h
gu
rtu %
Po 0.69 rkish

7. I
Tu %

59 ndi
0.69 rala
Ke 9%

Fast Food
0.6 adi

% a
rab
de 9%
Hy
0.6 njabi

n Pu 9%
0.6
Pa
sta
s

Desserts
9%
0.6
ery
Bak
9%
0.6
se
ane
Leb %
0.69 n

Biryani Med
iterranea
0.69
%
Arab
ian
0.69%
American
Jain

6.9% 0.69%
Sweets
0.69%
Beverages
Pan-Asian
1.38%
Ice Cream
1.38%
Pizzas
Fast Food
Indian
1.38%
Salads
Andhra
6.21% 1.38%
Cafe Seafood
1.38%

rts Co
Thai
1.38 Italian
sse
ntin %
2.0 ental
De 52% 7% Mexican
5.
As
2 ian
M .07% Healthy Food
a n

u
2. ghla
4. eric

07
4%

% i Snacks
5% s

He 2.0

Sn .07% d
Am

3.4 rage
1

ac
2
lth

ks

Mughlai
yF
ve

Me 7%
7%
Seafood
as

oo
Andhra

2.0
%

3.45%
Be

Italia

xic
3.45%

2.76

Asian
Pizz

an
3.45

n
%

Continental

Conclusion:

From the above Visualizations, We can say, In Koramangala Area, "Chinese" Cuisines are dominated by around '10.3%' followed by "North Indian" &
"South Indian" Cuisines '9.66%' & '7.59%' Restaurants respectively.
So, We can also infer that Most of the people are fond of the "Chinese" Cuisines.

WordCloud Representation for Cuisines:


In [82]: ##Q. Most preferred Cuisines by the Customers:
df_Swiggy

Out[82]:
Shop_Name Cuisine Location Rating Cost_for_Two (₹)

0 Kanti Sweets Sweets Koramangala, Koramangala 4.3 150

1 Mumbai Tiffin North Indian, Home Food, Thalis, Combo Sector 5, HSR 4.4 400

2 Sri Krishna sagar South Indian, North Indian, Fast Food, Beverag... 6th Block, Koramangala 4.1 126

3 Al Daaz American, Arabian, Chinese, Desserts, Fast Foo... HSR, HSR 4.4 400

4 Beijing Bites Chinese, Thai 5th Block, Koramangala 4.1 450

... ... ... ... ... ...

113 Wok Paper Scissors Pan-Asian, Chinese, Asian JNC Road, Koramangala 3.9 219

114 Savoury Restaurant Arabian, Middle Eastern, North Indian, Grill, ... Madiwala, BTM 4.1 600

115 Royal Treat North Indian, Chinese, Seafood, Biryani 5th block Koramangala, Koramangala 4.2 193

116 Thali 99 North Indian Koramangala, Koramangala 4.3 200

117 Mani's Dum Biryani Andhra, Biryani 1st Block, Koramangala 4.2 400

118 rows × 5 columns

In [83]: df_Swiggy['Cuisine']

Out[83]: 0 Sweets
1 North Indian, Home Food, Thalis, Combo
2 South Indian, North Indian, Fast Food, Beverag...
3 American, Arabian, Chinese, Desserts, Fast Foo...
4 Chinese, Thai
...
113 Pan-Asian, Chinese, Asian
114 Arabian, Middle Eastern, North Indian, Grill, ...
115 North Indian, Chinese, Seafood, Biryani
116 North Indian
117 Andhra, Biryani
Name: Cuisine, Length: 118, dtype: object

In [84]: df_Swiggy_Text = ', '.join(df_Swiggy['Cuisine'])


df_Swiggy_Text

Out[84]: 'Sweets, North Indian, Home Food, Thalis, Combo, South Indian, North Indian, Fast Food, Beverages, Jain, American, Ar
abian, Chinese, Desserts, Fast Food, Mughlai, North Indian, Chinese, Thai, North Indian, Fast Food, North Indian, Chi
nese, Italian, South Indian, Kerala, Chinese, North Indian, Pizzas, Italian, Mexican, Chinese, South Indian, North In
dian, Desserts, Fast Food, Kerala, Andhra, Beverages, Mughlai, Seafood, Desserts, Chinese, Andhra, Biryani, Seafood,
Chinese, South Indian, Chinese, Desserts, North Indian, Arabian, Fast Food, Desserts, Beverages, North Indian, North
Indian, Indian, Rajasthani, Desserts, Bakery, Chinese, Healthy Food, North Indian, North Indian, Chinese, Hyderabadi,
Fast Food, Chinese, Jain, North Indian, South Indian, Indian, North Indian, South Indian, Chinese, Andhra, Biryani, C
hinese, Desserts, Fast Food, Seafood, South Indian, American, Fast Food, Biryani, Seafood, North Indian, Chinese, Des
serts, Andhra, South Indian, Snacks, American, North Indian, South Indian, Kerala, South Indian, Mexican, North India
n, Chinese, Biryani, North Indian, Chinese, Biryani, North Indian, Chinese, Biryani, North Indian, Turkish, Portugues
e, American, Biryani, Desserts, South Indian, Snacks, North Indian, Chinese, Desserts, Desserts, Fast Food, Sweets, C
haat, Chinese, South Indian, Andhra, Hyderabadi, Pizzas, Fast Food, Biryani, Mughlai, South Indian, Chinese, Asian, N
orth Indian, Chinese, South Indian, Italian, Desserts, Pizzas, Biryani, Andhra, South Indian, Chinese, Continental, I
talian, Mediterranean, Thai, Lebanese, American, Asian, Beverages, Bakery, Biryani, Cafe, Desserts, Healthy Food, Mex
ican, North Indian, Salads, Pizzas, Biryani, Pizzas, Chinese, Pastas, Salads, American, Continental, North Indian, Am
erican, Fast Food, South Indian, Andhra, Biryani, Chinese, South Indian, North Indian, Fast Food, Fast Food, Beverage
s, Desserts, Bakery, Biryani, South Indian, North Indian, Fast Food, Andhra, Beverages, Mughlai, Seafood, Punjabi, Hy
derabadi, Chinese, Biryani, Chinese, Beverages, Chinese, North Indian, South Indian, Biryani, Kerala, North Indian, C
hinese, Kerala, Chinese, North Indian, Chinese, Arabian, Beverages, Biryani, Chinese, Desserts, North Indian, Biryan
i, Juices, Kebabs, Andhra, South Indian, North Indian, American, Fast Food, Beverages, Cafe, Snacks, North Indian, So
uth Indian, Turkish, Portuguese, American, Grill, Home Food, Healthy Food, Indian, Andhra, Biryani, Chinese, Dessert
s, Fast Food, Seafood, South Indian, Chinese, Thai, Chinese, Ice Cream, Chinese, Hyderabadi, Biryani, Indian, South I
ndian, Andhra, Tandoor, Punjabi, North Indian, Chinese, Fast Food, Healthy Food, Mughlai, Desserts, American, North I
ndian, Biryani, Hyderabadi, Andhra, North Indian, South Indian, Chinese, Fast Food, Juices, North Indian, North India
n, Chaat, Snacks, Fast Food, Desserts, Indian, Desserts, Mughlai, Seafood, Ice Cream, Desserts, Ice Cream, Desserts,
Fast Food, Italian, Biryani, North Indian, North Indian, Snacks, American, Desserts, South Indian, Chinese, North Ind
ian, Biryani, Kebabs, Andhra, Chettinad, Chinese, Mughlai, North Indian, Chettinad, South Indian, Continental, India
n, Pan-Asian, Oriental, North Indian, South Indian, North Indian, Biryani, North Indian, South Indian, Andhra, Biryan
i, Pan-Asian, Chinese, Asian, Arabian, Middle Eastern, North Indian, Grill, Seafood, Kerala, Chinese, North Indian, C
hinese, Seafood, Biryani, North Indian, Andhra, Biryani'

In [85]: from wordcloud import WordCloud

In [86]: import nltk


from nltk.corpus import stopwords

In [87]: stopwords_ENG = set(stopwords.words('english'))


stopwords_ENG

Out[87]: {'a',
'about',
'above',
'after',
'again',
'against',
'ain',
'all',
'am',
'an',
'and',
'any',
'are',
'aren',
"aren't",
'as',
'at',
'be',
'because',
'been',
'before',
'being',
'below',
'between',
'both',
'but',
'by',
'can',
'couldn',
"couldn't",
'd',
'did',
'didn',
"didn't",
'do',
'does',
'doesn',
"doesn't",
'doing',
'don',
"don't",
'down',
'during',
'each',
'few',
'for',
'from',
'further',
'had',
'hadn',
"hadn't",
'has',
'hasn',
"hasn't",
'have',
'haven',
"haven't",
'having',
'he',
'her',
'here',
'hers',
'herself',
'him',
'himself',
'his',
'how',
'i',
'if',
'in',
'into',
'is',
'isn',
"isn't",
'it',
"it's",
'its',
'itself',
'just',
'll',
'm',
'ma',
'me',
'mightn',
"mightn't",
'more',
'most',
'mustn',
"mustn't",
'my',
'myself',
'needn',
"needn't",
'no',
'nor',
'not',
'now',
'o',
'of',
'off',
'on',
'once',
'only',
'or',
'other',
'our',
'ours',
'ourselves',
'out',
'over',
'own',
're',
's',
'same',
'shan',
"shan't",
'she',
"she's",
'should',
"should've",
'shouldn',
"shouldn't",
'so',
'some',
'such',
't',
'than',
'that',
"that'll",
'the',
'their',
'theirs',
'them',
'themselves',
'then',
'there',
'these',
'they',
'this',
'those',
'through',
'to',
'too',
'under',
'until',
'up',
've',
'very',
'was',
'wasn',
"wasn't",
'we',
'were',
'weren',
"weren't",
'what',
'when',
'where',
'which',
'while',
'who',
'whom',
'why',
'will',
'with',
'won',
"won't",
'wouldn',
"wouldn't",
'y',
'you',
"you'd",
"you'll",
"you're",
"you've",
'your',
'yours',
'yourself',
'yourselves'}

In [88]: # wordcloud = WordCloud(width = 1000, height = 500, stopwords = stopwords_ENG).generate(text = df_Swiggy_Text)


# plt.figure(figsize = (22, 7))
# plt.imshow(wordcloud)
# plt.axis('off')
# plt.show()

In [89]: wordcloud = WordCloud(width = 1000, height = 500, stopwords = stopwords_ENG, background_color = 'white').generate(df
_Swiggy_Text)
plt.figure(figsize = (22, 7))
plt.imshow(wordcloud)
plt.axis('off')
plt.show()

In [90]: # Save the Image in the 'img' Folder:


wordcloud.to_file("img/Cuisins.png")

In [ ]:

In [ ]:

You might also like