Multiple Time Series Comparison
📖 Scenario: You work as a data analyst for a small retail company. You have sales data for three different products over a week. Your manager wants to see how the sales of these products compare day by day in a single chart.
🎯 Goal: Create a line chart that compares the daily sales of three products over one week using matplotlib. You will prepare the sales data, set up the days of the week, plot all three products on the same graph with labels, and display the chart.
📋 What You'll Learn
Create a dictionary called
sales_data with keys 'Product A', 'Product B', and 'Product C' and their daily sales as lists of integers.Create a list called
days with the days of the week from Monday to Sunday.Use
matplotlib.pyplot to plot the sales of all three products on the same line chart with appropriate labels and a legend.Display the plot using
plt.show().💡 Why This Matters
🌍 Real World
Comparing multiple time series data visually helps businesses understand trends and make decisions, such as comparing sales of different products over time.
💼 Career
Data analysts and scientists often need to visualize and compare multiple data series to communicate insights clearly to stakeholders.
Progress0 / 4 steps