Project 29: Sales Channel Comparison Chart
Data Analyst
Builds on these lessons
Current Task
Objective
.plot() on a DataFrame can chart multiple columns at once by passing a list to y= — useful for comparing several series side by side.
Task: plot online vs. in_store sales by month as a grouped bar chart and print the DataFrame.
index.py
import pandas as pd
sales = pd.DataFrame({'month': ['Jan', 'Feb', 'Mar'], 'online': [500, 600, 550], 'in_store': [300, 280, 320]})
ax = sales.plot(x='month', y=['online', 'in_store'], kind='bar')
print(sales)
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview