6. Average rating pivot table
MediumPandas & NumPy
Rows have product, month and rating. Return a dict mapping each product to a dict of month → average rating (rounded to 1 decimal). Include only months that have ratings for that product.
Input rows arrive as a list of dictionaries; build a DataFrame with pd.DataFrame(rows).
Example 1
Input: …
Output: {'app': {'jan': 4.5, 'feb': 3.0}}Constraints
Ratings are 1–5