Python Foundations - Project Support
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Getting Started with Data Analysis
Common Statistical Measures
Significance of Data Visualization
Agenda
sajjad_rio@[Link]
I8EPJ1SBAG
Choosing plots for Univariate/Bivariate Analysis
FoodHub - Business Context & objective
FoodHub - Full-Code/Low-Code Version
FoodHub - Q/A
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Let’s begin the discussion by answering a few questions on
sajjad_rio@[Link]
Python programming and Exploratory Data Analysis
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Which of the following represents the correct sequence of steps to begin data
analysis?
A Import Libraries => EDA => Load dataset
sajjad_rio@[Link]
I8EPJ1SBAG
B Load dataset => Import Libraries => EDA
D Import Libraries => Load dataset => EDA
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Which of the following represents the correct sequence of steps to begin data
analysis?
A Import Libraries => EDA => Load dataset
sajjad_rio@[Link]
I8EPJ1SBAG
B Load dataset => Import Libraries => EDA
D Import Libraries => Load dataset => EDA
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Getting Started with Data Analysis
1 Importing Packages Loading the Dataset 2
Using pandas functions, we load the dataset in a
In this step, we import all the necessary packages dataframe. For csv files, ‘pd.read_csv( )’ is used.
such as numpy, pandas, matplotlib, seaborn etc. For excel files, ‘pd.read_excel( )’ is used.
sajjad_rio@[Link]
I8EPJ1SBAG
3 Exploratory Data Analysis
In this step, we look for the shape of the dataset, the different data
types, check for anomalous and missing values, and analyse the
attributes individually as well as relationships between them through
visualizations to identify key business insights
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Consider the file foodhub_order.csv stored in the following folder hierarchy
Python => Project => Dataset
Which of the following code snippets is the correct way to load the file into a
pandas dataframe in Google Colab?
sajjad_rio@[Link]
I8EPJ1SBAG A df = pd.read_csv("Python/Project/Dataset/foodhub_order.csv")
B df = pd.read_csv("Python\Project\Dataset\foodhub_order.csv")
C df = pd.read_csv("Python//Project//Dataset//foodhub_order.csv")
D df = pd.read_csv("Python\\Project\\Dataset\\foodhub_order.csv")
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Consider the file foodhub_order.csv stored in the following folder hierarchy
Python => Project => Dataset
Which of the following code snippets is the correct way to load the file into a
pandas dataframe in Google Colab?
sajjad_rio@[Link]
I8EPJ1SBAG A df = pd.read_csv("Python/Project/Dataset/foodhub_order.csv")
B df = pd.read_csv("Python\Project\Dataset\foodhub_order.csv")
C df = pd.read_csv("Python//Project//Dataset//foodhub_order.csv")
D df = pd.read_csv("Python\\Project\\Dataset\\foodhub_order.csv")
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Loading Datasets in Pandas
read_csv - pandas function used to load datasets in CSV format into a pandas dataframe
Syntax: df = pd.read_csv(“file_path/file_name.csv”)
Pandas has to be imported with alias pd - import pandas as pd
sajjad_rio@[Link]
I8EPJ1SBAG
The file name has to be enclosed in quotation marks (single or double)
Above syntax works when the file (dataset) is in the same working directory as the Python
notebook
When the file (dataset) and the Python notebook are not in the same working directory,
the path to the file has to be specified
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Which of the following measures condense the dataset down to one
representative central value?
A Mean, Median, Mode
sajjad_rio@[Link]
I8EPJ1SBAG
B Standard Deviation, Variance, Range
C Correlation Coefficient
D Maximum, Median, Minimum
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Which of the following measures condense the dataset down to one
representative central value?
A Mean, Median, Mode
sajjad_rio@[Link]
I8EPJ1SBAG
B Standard Deviation, Variance, Range
C Correlation Coefficient
D Maximum, Median, Minimum
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Common Statistical Measures
Central tendency measures condense the dataset down to one representative central value
Allows us to compare one dataset to another
sajjad_rio@[Link] Mean
Mean Median
Median Mode
Mode
I8EPJ1SBAG
The mean is the arithmetic average The median is the middle score in a The mode is the most frequent
of a set of given numbers. set of given numbers. score in a set of given numbers.
df[‘column_name’].mean( ) df[‘column_name’].median( ) df[‘column_name’].mode( )[0]
The mean can be used to Since the mean is highly affected Mode is the preferred measure
represent the typical value and by the outliers, the median is a
when data is categorical.
therefore serves as a yardstick for better choice for a dataset with
all observations. extreme values
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Consider a dataframe df with two attributes "height" and "weight". Which of
the following methods can be used to check the correlation between these
two variables?
A [Link]()
sajjad_rio@[Link]
I8EPJ1SBAG
B [Link](df)
C [Link](data=df, x='height')
D [Link](df['height'], df['weight'])
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Consider a dataframe df with two attributes "height" and "weight". Which of
the following methods can be used to check the correlation between these
two variables?
A [Link]()
sajjad_rio@[Link]
I8EPJ1SBAG
B [Link](df)
C [Link](data=df, x='height')
D [Link](df['height'], df['weight'])
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Common Statistical Measures
Correlation is a measure of association between two variables
Correlation coefficient is a statistical measure of the strength of the linear relationship
between two variables.
[Link](df['height'],
sajjad_rio@[Link]
[Link]() [Link](df)
df['weight'])
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Common Statistical Measures
Based on direction of change in the value of one variable as the value of the other changes, the
two variables are said to have a positive relationship, negative relationship, or no relationship
at all.
sajjad_rio@[Link]
I8EPJ1SBAG
+ve correlation -ve correlation No correlation
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Consider a dataframe df containing information about CustomerID, Region,
Purchase Amount. which of the following statements is true?
A [Link]()provides information about data types of columns
sajjad_rio@[Link]
I8EPJ1SBAG
df.value_counts('CustomerID') returns a single number
B
representing the total count of the values in the 'CustomerID' column
[Link]() returns the counts, mean, standard deviation, min, max,
C
and quartiles of numeric columns
[Link]('Region')[‘Purchase Amount’].sum() provides the
D
total sum of amount of purchase by different regions
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Consider a dataframe df containing information about CustomerID, Region,
Purchase Amount. which of the following statements is true?
A [Link]()provides information about data types of columns
sajjad_rio@[Link]
I8EPJ1SBAG
df.value_counts('CustomerID') returns a single number
B
representing the total count of the values in the 'CustomerID' column
[Link]() returns the counts, mean, standard deviation, min, max,
C
and quartiles of numeric columns
[Link]('Region')[‘Purchase Amount’].sum() provides the
D
total sum of amount of purchase by different regions
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Pandas
One of the most commonly used Python libraries for data manipulation and analysis
[Link]( ) [Link] [Link]( ) [Link]( )
The [Link]( ) function The [Link]() function
The [Link]( ) function The [Link] returns the
sajjad_rio@[Link] convert the data type of an returns information about
returns the first 5 rows of number of rows and
I8EPJ1SBAG existing column in a the dataframe including the
the dataframe columns of the dataframe
dataframe data types of each column
and memory usage
[Link]( ) [Link]( ) [Link]( ) df.value_counts( )
The [Link]() function The [Link]( ) function
The [Link]() function The df.value_counts( )
returns the statistical info function is used to split the
returns the unique returns a Series containing
like percentile, mean, data into groups
values present in a the counts of unique values.
standard deviation, etc. of
dataframe
the dataframe
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
According to the jointplot below, where is the highest density of data points?
A Total bill ~(15 – 20) & Tip ~(3 - 4)
sajjad_rio@[Link]
I8EPJ1SBAG
B Total bill ~(5 - 10) & Tip ~(1.5 - 2.5)
C Total bill ~(10 - 20) & Tip ~(1.5 - 2.5)
D Total bill ~(25 - 35) & Tip ~(3 - 4)
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
According to the jointplot below, where is the highest density of data points?
A Total bill ~(15 – 20) & Tip ~(3 - 4)
sajjad_rio@[Link]
I8EPJ1SBAG
B Total bill ~(5 - 10) & Tip ~(1.5 - 2.5)
C Total bill ~(10 - 20) & Tip ~(1.5 - 2.5)
D Total bill ~(25 - 35) & Tip ~(3 - 4)
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Significance of Data Visualization
Gives us a better idea of the information stored in data by giving it visual context through
various plots
Allows us to visualize large volumes of data in an understandable and coherent way
sajjad_rio@[Link]
I8EPJ1SBAG
Also enables us to identify relationships and patterns within data
Helps us comprehend the information and draw conclusions and insights
Enables data storytelling to easily create a narrative through graphics and diagrams
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Which of the following the combination of plot and type of data is generally
used for univariate analysis?
A Boxplot - Numerical Data
sajjad_rio@[Link]
I8EPJ1SBAG
B Histogram - Numerical data
C Lineplot - Categorical Data
D Countplot - Categorical Data
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Python Programming & EDA Quiz
Which of the following the combination of plot and type of data is generally
used for univariate analysis?
A Boxplot - Numerical Data
sajjad_rio@[Link]
I8EPJ1SBAG
B Histogram - Numerical data
C Lineplot - Categorical Data
D Countplot - Categorical Data
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Choosing plots for Univariate Analysis
When to use a Histogram
When the data is numeric and you want to see the shape of the data
distribution, determine whether the data is distributed approximately
normally (bell shaped) or not
[Link]( data = , x = ‘ ‘, kde = True )
sajjad_rio@[Link]
I8EPJ1SBAG
When to use Boxplot
When the data is numeric and you want to understand the centre,
spread, and presence of outliers
[Link]( data = , x = ‘ ‘)
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Choosing plots for Univariate Analysis
When to use a Count plot
When the data is categorical and you want to show the counts of
observations in each categorical bin
[Link]( data = , x = ‘ ‘)
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Choosing plots for Bivariate Analysis
When to use a scatter plot
When the data is numeric and you want to determine whether the two
variables are related, and see if it's a positive or negative correlation.
[Link]( data = , x = ‘ ‘, y = ‘ ‘ )
sajjad_rio@[Link]
I8EPJ1SBAG
When to use a line chart
When the data is continuous and you want to see the how the value
of something changes over short and long periods of time.
[Link]( data = , x = ‘ ‘, y = ‘ ‘ )
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Business Context and Objective
The number of restaurants in New York is increasing day by day. Lots of students and busy
professionals rely on those restaurants due to their hectic lifestyles. Online food delivery
service is a great option for them. It provides them with good food from their favorite
restaurants. A food aggregator company FoodHub offers access to multiple restaurants
through a single smartphone app.
sajjad_rio@[Link]
I8EPJ1SBAG
The app allows the restaurants to receive a direct online order from a customer. The app
assigns a delivery person from the company to pick up the order after it is confirmed by the
restaurant. The delivery person then uses the map to reach the restaurant and waits for the
food package.
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Business Context and Objective
Once the food package is handed over to the delivery person, he/she confirms the pick-up in
the app and travels to the customer's location to deliver the food. The delivery person
confirms the drop-off in the app after delivering the food package to the customer. The
customer can rate the order in the app. The food aggregator earns money by collecting a fixed
margin of the delivery order from the restaurants.
sajjad_rio@[Link]
I8EPJ1SBAG
The food aggregator company has stored the data of the different orders made by the
registered customers in their online portal. They want to analyze the data to get a fair idea
about the demand of different restaurants which will help them in enhancing their customer
experience. Suppose you are hired as a Data Scientist in this company and the Data Science
team has shared some of the key questions that need to be answered. Perform the data
analysis to find answers to these questions that will help the company to improve the
business.
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Data Dictionary
Data Data Description
order_id Unique ID of the order
customer_id ID of the customer who ordered the food
restaurant_name
sajjad_rio@[Link] Name of the restaurant
I8EPJ1SBAG
cuisine_type Cuisine ordered by the customer
cost Cost of the order
day_of_the_week Indicates whether the order is placed on a weekday or weekend (The weekday
is from Monday to Friday and the weekend is Saturday and Sunday)
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Data Dictionary
Data Data Description
rating Rating given by the customer out of 5
food_preparation Time (in minutes) taken by the restaurant to prepare the food. This is calculated
_time by taking the difference between the timestamps of the restaurant's order
sajjad_rio@[Link] confirmation and the delivery person's pick-up confirmation.
I8EPJ1SBAG
delivery_time Time (in minutes) taken by the delivery person to deliver the food package. This
is calculated by taking the difference between the timestamps of the delivery
person's pick-up confirmation and drop-off information
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
Step 1: Upload the csv file in the Google Drive
Step 2: Create a new notebook / open an existing notebook
Step 3: Import pandas library into the notebook. The following code can be used for the same
sajjad_rio@[Link]
I8EPJ1SBAG
import pandas as pd
Step 4: Mount Google Drive in the notebook. This can be done via two approaches:
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
Approach 1
Step i: Click on the Files option on the left
Step ii: Select the Mount Drive option
sajjad_rio@[Link]
I8EPJ1SBAG
Step iii: In the pop-up that appears, select Connect to Google Drive option
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
Approach 2
Step i: Run the following command in the notebook
from [Link] import drive
[Link]('/content/drive')
sajjad_rio@[Link]
I8EPJ1SBAG
Step ii: In the pop-up that appears, select Connect to Google Drive option
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
Step 5: Expand the Drive option, and browse to your working directory
Step 6: Right-click on the file and select Copy path
For example, if we want to load the file [Link], which is present in the Colab Notebooks
folder in MyDrive, we would navigate to the folder and right-click on the file to get the file path
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
Step 7: Create a variable path and set the copied file path as the value of the variable (you can
simply paste the copied file path for this)
Step 8: Pass the path variable as an argument of the pandas read_csv() function to load the file
into a pandas dataframe and store it in a variable
sajjad_rio@[Link]
I8EPJ1SBAG
For example: df = pd.read_csv(path)
Step 9: Call the head() function of the dataframe to check if the data is imported correctly
For example: [Link]()
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Google Colab
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Jupyter Notebook
Step 1: Download the CSV file you want to work with
Step 2: Locate the file in the Local Drive
Step 3: Right-click on the file and click on Properties and copy the file location
sajjad_rio@[Link]
I8EPJ1SBAG
Step 4: Import numpy and pandas
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Jupyter Notebook
Step 5: Paste the path in the variable path and add the filename at the end, as shown below
It is important to replace the single backslash (i.e., \) in the file path with a double
backslash (i.e., \\), a single forward slash (i.e., /), or a double forward slash (i.e., //).
For example: if the
sajjad_rio@[Link]
I8EPJ1SBAG
filename is [Link] and the file path is C:\Users\User\Downloads ,
then the path variable should be defined as one of the following:
path = 'C:\\Users\\User\\Downloads\\[Link]'
path = 'C:/Users/User/Downloads/[Link]'
path = 'C://Users//User//Downloads//[Link]'
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Jupyter Notebook
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Jupyter Notebook
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Jupyter Notebook
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How to Load Dataset in Jupyter Notebook
Step 6: Call the path variable in the read_csv() function of pandas to load the file into a pandas
dataframe, and store it in a variable
For example: df = pd.read_csv(path)
Step 7: Call the head() function of the dataframe to check if the data is imported correctly
sajjad_rio@[Link]
I8EPJ1SBAG
For example: [Link]()
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Low-code Version
For learners who aspire to be in managerial roles in the future, focusing on solution review,
interpretation, recommendations, and communication with business stakeholders
Download the dataset and the Learner Notebook - Low Code (this is a template notebook)
sajjad_rio@[Link]
I8EPJ1SBAG
Fill in the blanks in the notebook to complete and execute the code to solve the questions and
perform all the tasks as per the grading rubric
Once the notebook is completely executed and necessary outputs obtained, a business
presentation (using Microsoft PowerPoint, Google Slides, etc.) has to be created
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Low-code Version
The presentation should contain observations, insights, and recommendations for the business
problem
The presentation template provided can be referred to as a sample
Once the presentation is complete, convert the presentation to .pdf format
sajjad_rio@[Link]
I8EPJ1SBAG
The presentation should be submitted as a PDF file (.pdf) and NOT as a .pptx file
Please make sure that all the sections mentioned in the grading rubric have been covered in
the submission
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Full-code Version
For learners who aspire to be in hands-on coding roles in the future, focusing on building
solution codes from scratch
Download the dataset and the Learner Notebook - Full Code (this is a template notebook
containing high-level steps to perform and insight-based questions)
sajjad_rio@[Link]
Write necessary
I8EPJ1SBAG code to solve the questions and perform all the tasks as per the grading rubric
Clearly write down observations, insights, and recommendations for the business problem
based on the analysis performed
Once the notebook is complete, download it as a .ipynb file and convert it to a .html file
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Full-code Version
The notebook should be submitted as an HTML file (.html) and NOT as a notebook file
(.ipynb)
The conversion can be done via one of the following ways:
Jupyter Notebook:
sajjad_rio@[Link]
I8EPJ1SBAG Google
Colab: Use free online tools
Please make sure that all the sections mentioned in the grading rubric have been covered in
the submission
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
FoodHub - Q/A
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 49
FoodHub - Project FAQs
How to approach Question 13?
The company wants to provide a promotional offer in the advertisement of the
restaurants. The condition to get the offer is that the restaurants must have a rating count
of more than 50 and the average rating should be greater than 4. Find the restaurants
fulfilling the criteria to get the promotional offer.
sajjad_rio@[Link]
I8EPJ1SBAG
Step 1: Filter the restaurant's column for those restaurants that do not have a rating as 'Not
given'
Step 2: Convert the rating column created above from object to integer datatype
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 50
FoodHub - Project FAQs
Step 3: Create a dataframe that contains the restaurant names with their rating counts
Step 4: Get all the restaurant names that have a rating count of more than 50
Step 5: find the mean rating of the restaurants by using the group by function
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 51
FoodHub - Project FAQs
How to approach Question 14?
The company charges the restaurant 25% on the orders having cost greater than 20
dollars and 15% on the orders having cost greater than 5 dollars. Find the net revenue
generated by the company across all orders.
sajjad_rio@[Link]
Step 1: Create
I8EPJ1SBAG a function with conditional statements (for each category, 25%, 15% and
0%(else condition) and mention the revenue for each condition.
Step 2: Apply these conditions on the cost_of_the_order column to calculate the revenue, same
the value in a revenue column.
Step 3: Taking summation of the revenue column will give the total revenue.
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 52
FoodHub - Project FAQs
Is there a way to transfer the graphs from Google Colab to the presentation without it
looking blurry?
There are multiple ways to transfer the graphs :
1. Use the following
sajjad_rio@[Link] line of code just after the visualization code:
I8EPJ1SBAG
[Link]("[Link]", bbox_inches='tight')
For example:
[Link](data=data, x='column')
[Link]("[Link]", bbox_inches='tight')
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 53
FoodHub - Project FAQs
2. Use the snipping tool to snip the visual plot from the Jupyter notebook and paste the snip in
ppts.
3. Right-click on the image and click on copy and paste the copied plot in the ppt or document.
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited. 54
Happy Learning !
sajjad_rio@[Link]
I8EPJ1SBAG
This file is meant for personal use by sajjad_rio@[Link] only.
Sharing or publishing the contents in part or full is liable for legal action. 55
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.