Question: Q 2 . Read the file marketing _ campaign.csv . The dataset records 1 5 6 0 customers' different information, each row represents one customer.

Q2. Read the file marketing_campaign.csv. The dataset records 1560 customers' different information, each row
represents one customer. The variable names are self-explanatory. Answer the following questions.
Please answer the questions below with Python, display the codes, result and graphs clearly.
(a)[1 points] What are the unique values in the variable Marital_Status?
(b)[4 points] How many Single and Married customers are there in this data set?
(c)[4 points] Show the mean Income of Single and Married customers. Which group has a higher mean
Income?
(d)[4 points] Visualize the distribution of variable Income across different Marital_Status with a boxplot.
Your result should look like the below. (Hints: pay attention to the axis labels and the plot title.)
(e)[4 points] According to the boxplot, which group (i.e., married, single or divorced) has the highest
maximum Income? And which group has the highest median Income? Explain your answer.
(f)[4 points] Create a subset named subset 2 in which the "Divorced" customers are excluded. How many
customers are there in the subset?
(g)[4 points] Visualize the density of Income in subset 2 with a density plot. Add a vertical red line to show
the average income in the data set. Your output should look similar as below graph. (Hints: pay attention
to the axis labels and the plot title.)
(h)[2 points] Based on your answer in part (g), is the Income normally distributed? Explain your answer.
Q 2 . Read the file marketing _ campaign.csv .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!