ZOMATO COMPANY DATA ANALYSIS PROJECT :
import
import
import
import
pandas as pd
numpy as np
matplotlib.pyplot as plt
seaborn as sns
# create the dataframe
df= pd.read_csv("/content/Zomato data .csv")
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 20,\n
\"samples\": [\n
\"4.1/5\",\n
\"2.6/5\"\n
],\
n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\": \"votes\",\n
\"properties\":
{\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\":
90,\n
\"samples\": [\n
244,\n
31\n
],\
n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\": \"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":
223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"listed_in(type)\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 4,\n
\"samples\":
[\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
df
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 20,\n
\"samples\": [\n
\"4.1/5\",\n
\"2.6/5\"\n
],\
n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\": \"votes\",\n
\"properties\":
{\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\":
90,\n
\"samples\": [\n
244,\n
31\n
],\
n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\": \"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":
223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"listed_in(type)\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 4,\n
\"samples\":
[\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
DATA CLEANING :
def HandleRate(value):
value= str(value).split('/')
value=value[0];
return float(value)
df["rate"]= df["rate"].apply(HandleRate)
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
SUMMARY OF DATASET :
df.info()
RangeIndex: 148 entries, 0 to 147
Data columns (total 7 columns):
#
Column
Non-Null Count
--- ------------------0
name
148 non-null
1
online_order
148 non-null
2
book_table
148 non-null
3
rate
148 non-null
Dtype
----object
object
object
float64
4
votes
148 non-null
5
approx_cost(for two people) 148 non-null
6
listed_in(type)
148 non-null
dtypes: float64(1), int64(2), object(4)
memory usage: 8.2+ KB
int64
int64
object
TYPE OF RESTAURANT :
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
sns.countplot(x=df["listed_in(type)"])
plt.xlabel("Type Of Restaurant")
Text(0.5, 0, 'Type Of Restaurant')
# CONCLUSION:
# The majority of the customers falls inte the Dining Category,Dining
Restaurants are preferred by a larger number of individuals.
VOTES RECEIVED FROM CUSTOMERS :
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
grouped_data= df.groupby("listed_in(type)")["votes"].sum()
result= pd.DataFrame({'votes': grouped_data})
plt.plot(result, c='green', marker="o")
plt.xlabel("Type of Restaurant",c="red", size=20)
plt.ylabel("Votes",c="red",size=20)
plt.show()
# CONCLUSION :
# Dining restaurants has received maximum Votes##
MAJORITY RESTAURANTS RECEIVED RATINGS :
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
plt.hist(df["rate"],bins=5)
plt.title("Rating Distribution")
plt.show()
# Conclusion:
# The Majority Restaurants received Ratings from 3.5 to 4.00
AVERAGE SPENDING FROM COUPLES ON EACH ONLINE ORDER :
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
couple_data=df["approx_cost(for two people)"]
sns.countplot(x=couple_data)
# CONCLUSION:
# The majority of Couples prefer Restaurants with approximate cost of
300 rupees
WHICH MODE(ONLINE/OFFLINE) HAS RECEIVED THE MAXIMUM RATINGS :
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
plt.figure(figsize=(6,6))
sns.boxplot(x=df["online_order"],y=df["rate"])
# CONCLUSION :
# ONLINE ORDERS RECEIVE HIGHER RATINGS THEN OFFLINE ORDERS
WHICH TYPE OF RESTAURANTS RECEIVE MORE OFFLINE ORDERS ? :
df.head()
{"summary":"{\n \"name\": \"df\",\n \"rows\": 148,\n \"fields\": [\
n
{\n
\"column\": \"name\",\n
\"properties\": {\n
\"dtype\": \"string\",\n
\"num_unique_values\": 145,\n
\"samples\": [\n
\"The Biryani Cafe\",\n
\"Melting
Melodies\",\n
\"Cuppa\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"online_order\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 2,\n
\"samples\": [\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"book_table\",\n
\"properties\": {\n
\"dtype\":
\"category\",\n
\"num_unique_values\": 2,\n
\"samples\":
[\n
\"No\",\n
\"Yes\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"rate\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\":-,\n
\"min\": 2.6,\n
\"max\": 4.6,\n
\"num_unique_values\":
19,\n
\"samples\": [\n
4.1,\n
4.0\
n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"votes\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 653,\n
\"min\": 0,\n
\"max\": 4884,\n
\"num_unique_values\": 90,\n
\"samples\": [\n
244,\n
31\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\n
},\n
{\n
\"column\":
\"approx_cost(for two people)\",\n
\"properties\": {\n
\"dtype\": \"number\",\n
\"std\": 223,\n
\"min\": 100,\n
\"max\": 950,\n
\"num_unique_values\": 18,\n
\"samples\": [\n
800,\n
300\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
},\n
{\n
\"column\": \"listed_in(type)\",\n
\"properties\": {\n
\"dtype\": \"category\",\n
\"num_unique_values\": 4,\n
\"samples\": [\n
\"Cafes\",\n
\"Dining\"\n
],\n
\"semantic_type\": \"\",\n
\"description\": \"\"\n
}\
n
}\n ]\n}","type":"dataframe","variable_name":"df"}
pivot_table= df.pivot_table(index="listed_in(type)",
columns="online_order", aggfunc="size", fill_value=0)
sns.heatmap(pivot_table, annot=True, cmap="YlGnBu", fmt='d')
plt.title("HeatMap")
plt.xlabel("Online Order")
plt.ylabel("listed_in(type)")
plt.show()
# CONCLUSION:
# DINING RESTAURANTS PRIMARILY RECEIVE OFFLINE ORDERS, WHEREAS CAFES
PRIMARILY RECEIVE ONLINE ORDERS,THIS SUGGESTS THAT CLIENTS PREFER TO
PLACE ORDERS IN PERSON AT RESTAURANTS,BUT PREFER ONLINE ORDERING AT
CAFES