Recap exercises: import, preparation and visualization
The following exercises are meant to help you recap what you learned in the areas of data import, data preparation and visualization.
Customer Satisfaction Tracking
Background: You work for a company that recently implemented new customer service protocols. Customer satisfaction data was collected at three time points: before the change (Q1), and at two follow-up periods (Q2, Q3). Customers rated their satisfaction with service quality and product value on a 1-5 scale. Each row represents one customerβs ratings across all three quarters.
Import data
Download the file customer_satisfaction.csvand place it in your working directory. Import the CSV file and store it in a variable called customers_data.
Prepare data
The data is currently in a wide format - each quarter is a separate column. Transform it to a tidy format where: - One column indicates the quarter (q1, q2, q3) - One column indicates the metric type (service_quality, product_value) - One column contains the rating value
Compute grouped averages
Calculate the mean rating for each combination of quarter and metric type. Store this in a new table called satisfaction_summary.
Visualization
Create a line plot showing how average customer satisfaction changes over quarters. It should have the quarters on the x-axis, the mean rating on the y-axis, and it should show different colors for service quality and product value.