Make a 2 × 2 grid of pie charts, one per region (alphabetical, across then down), each showing units per product (alphabetical) with product labels and titled with the region name.
import pandas as pd
sales = pd.DataFrame({
"region": ["North", "North", "North", "South", "South", "South", "East", "East", "East", "West", "West", "West"],
"product": ["Laptop", "Phone", "Tablet", "Laptop", "Phone", "Tablet", "Laptop", "Phone", "Tablet", "Laptop", "Phone", "Tablet"],
"units": [120, 300, 80, 150, 280, 60, 90, 220, 70, 160, 310, 95],
"revenue": [6000, 4500, 1600, 7500, 4200, 1200, 4500, 3300, 1400, 8000, 4650, 1900],
"rating": [4.2, 4.5, 3.9, 4.4, 4.1, 3.7, 4.0, 4.3, 3.8, 4.6, 4.4, 4.0],
})
import matplotlib.pyplot as pltDraw the chart. It is checked on what it shows: the data, the title and axis labels, the legend and the category names. Size and fonts don't matter.
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.