B.M.S.
COLLEGE OF ENGINEERING, BENGALURU - 19
(Autonomous Institute, Affiliated to VTU)
DEPARTMENT OF MACHINE LEARNING
Course: Data Analysis and Visualization Course Code: 24AM5PCDAV
L-T-P: 1-0-1 Section: 5C Marks: 20
Part - A
LAB Question
1 A. Identify missing values using isnull() and notnull() functions and create a
strategy for handling them with methods like fillna and dropna. What
impact does filling missing values in Occupation and Satisfaction_Level
have on analysis results?
B. Apply custom functions to create a transformed dataset—for instance,
converting the Satisfaction_Level to a binary variable where values above
0.7 are labeled as "High" and others as "Low."
C. Use map () to convert the Purchase_History categorical data into a
numerical format, where "High" is mapped to 2, "Medium" to 1, and
"Low" to 0.
2 A. Apply a function that removes duplicates based on all columns in the
DataFrame.
B. Write a function that replaces inconsistent values in the Gender column
(e.g., replace "M" with "Male" and "F" with "Female").
C. Write a function that groups values in the Age column into ranges, such as
"18-30," "30-40," and "40-50." Write a function that converts the City
column into dummy variables.
3 A. Use the Product and Month columns in the Sales Data DataFrame to create
a hierarchical index, and describe the benefits of this structure, such as
more efficient sub setting and grouping operations.
B. Concatenate a list of Sales Data Frames (e.g., data from different quarters)
both vertically (stacking rows) and horizontally (adding new columns).
Discuss the implications of each approach in combining data.
C. Write a function that combines the Sales Data and Customer Feedback
Data Frames, filling any missing Feedback_Score values in one with those
from the other
Page 1 of 2
5 A. Pivot the data to calculate the total revenue generated by each salesperson
on each date.
B. Show the percentage of total revenue contributed by each region.
C. Determine which salesperson completed the most sales transactions (count
of unique transactions).
D. Pivot the data to show both the total revenue and total units sold by each
salesperson for each product.
Part-B
Lab Question
6 A. What was the average attendance for the games throughout the season?
B. Which player scored the most points over the season? Create a bar chart
showing the total points scored by each player.
7 A. Create a heatmap to visualize Uber pickups by day of the week and hour of
the day.
B. Use a line chart to show the trend of Uber pickups across a specific month.
C. Create a bubble chart to display the number of pickups in different regions of
New York City, with the size of the bubbles representing the total number of
pickups.
8 A. Create a bar chart to visualize the survival rate based on passenger class
(Pclass).
B. Use a pie chart to show the proportion of survivors vs. non-survivors in the
dataset.
9 A. Create a scatter plot to visualize the relationship between GrLivArea (above
ground living area) and SalePrice.
B. Use a heatmap to visualize the correlation between numerical features like
GrLivArea, OverallQual, TotalBsmtSF, etc.
10 A. Create a bar chart to compare the number of players across different positions
(e.g., forwards, midfielders, defenders).
B. Use a donut chart to show the distribution of player ratings (Overall) by
player position (e.g., how many forwards, defenders, etc., fall into different
rating ranges).
Page 2 of 2