All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.
All our activities include solutions with explanations on how they work and why we chose them.
Create a histogram using Matplot's subplot
function to capture the fig and ax objects for Purchase
column of df
dataframe. Set the number of bins to 20 and specify the edge color as black
.
Create separate histograms to visualize and compare the distribution of purchase amounts among male and female customers. This analysis will provide insights into the spending patterns and preferences of the two gender groups.
Before creating histograms, separate the data into two groups(series): one for male customers and one for female customers. Store the series in male_data
and female_data
.
For each histogram, set the number of bins to 10 and specify the color of the bars to be blue for male and pink for female. Also, set the edge color to black for both histograms.
Do not change the given code template in the notebook.
Create a histogram with 20 bins for the purchase
variable specifically for Class A cities. Store the purchase data for Class A cities from this dataset in the variable class_a_data
.
Set the edge color as
black
.Do not change the given code template in the notebook.