Sales summary by store format

MediumWalmartmergenamed aggregation· 20 XP

Leadership wants a quick comparison of the two store formats.

Join sales.csv to stores.csv, and store one row per store_format with these columns:

  • sales: the number of sale rows
  • units: total units
  • revenue: total of units * unit_price, rounded to 2 decimals

Expected answer

Store your answer in result.

Hints, the later steps and the answer come with Pro.

import pandas as pd

sales = pd.read_csv("sales.csv")
stores = pd.read_csv("stores.csv")
result = ...