Zomoto Data analysis using python
Zomoto Data analysis using python
August 24
data
analysis
using 2024
python
Name:M.Danusri
Project Overview: Unveiling valuable insights from Zomato, a popular restaurant platform, requires the
power of Python. Libraries like Pandas and Matplotlib become your allies in this task. Pandas helps you
wrangle the Zomato data into a structured format, while Matplotlib brings it to life with informative
visualizations. Through data exploration and analysis, you can uncover hidden trends. Perhaps you’ll
identify popular cuisines by location or explore how pricing influences ratings. Python empowers you to
ask questions of the data and uncover knowledge that can benefit both restaurants and dinners.
Objectives:
Python and its following libraries are used to analyze Zomato data.
Numpy–
With Numpy arrays, complex computations are executed quickly, and large calculations are handled
efficiently.
Matplotlib–
It has a wide range of features for creating high-quality plots, charts, histograms, scatter plots, and
more.
Pandas–
The library simplifies the loading of data frames into 2D arrays and provides functions for performing
multiple analysis tasks in a single operation.
Seaborn–
It offers a high-level interface for creating visually appealing and informative statistical graphics.
Before commencing the data analysis, the following steps are followed.
Following steps are followed before starting to analyze the data.
Step 1: Import necessary Python libraries.
import pandas as pd
import numpy as np
print(dataframe.head())
output:
def handleRate(value):
value=str(value).split('/')
value=value[0];
return float(value)
dataframe['rate']=dataframe['rate'].apply(handleRate)
print(dataframe.head())
___________________________________
def handleRate(value):
value=str(value).split('/')
value=value[0];
return float(value)
dataframe['rate']=dataframe['rate'].apply(handleRate)
print(dataframe.head())
output:
dataframe.info()
output:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 148 entries, 0 to 147
Data columns (total 7 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 name 148 non-null object
1 online_order 148 non-null object
2 book_table 148 non-null object
3 rate 148 non-null float64
4 votes 148 non-null int64
5 approx_cost(for two people) 148 non-null int64
6 listed_in(type) 148 non-null object
dtypes: float64(1), int64(2), object(4)
memory usage: 8.2+ KB
We will now examine the data frame for the presence of any null values. This stage scans each column to
see whether there are any missing values or empty cells. This allows us to detect any potential data gaps
that must be addressed.
There is no NULL value in dataframe.
plt.xlabel("Type of restaurant")
output:
Conclusion: The majority of the restaurants fall into the dining category.
grouped_data = dataframe.groupby('listed_in(type)')['votes'].sum()
output:
Conclusion: Dining restaurants are preferred by a larger number of individuals.
Now we will determine the restaurant’s name that received the maximum votes based on a given
dataframe.
max_votes = dataframe['votes'].max()
print(restaurant_with_max_votes)
output:
sns.countplot(x=data['online_order'])
output:
Conclusion: This suggests that a majority of the restaurants do not accept online orders.
plt.hist(dataframe['rate'],bins=5)
plt.title("Ratings Distribution")
plt.show()
output:
Conclusion: The majority of restaurants received ratings ranging from 3.5 to 4.
Now we will examine whether online orders receive higher ratings than offline orders.
plt.figure(figsize = (6,6))
output:
CONCLUSION: Offline orders received lower ratings in comparison to online orders, which
obtained excellent ratings.
plt.title("Heatmap")
plt.xlabel("Online Order")
plt.ylabel("Listed In (Type)")
plt.show()
CONCLUSION: Dining restaurants primarily accept 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