题解 | 统计运动会项目报名人数
import pandas as pd from numpy import outer items = pd.read_csv('items.csv') signup = pd.read_csv('signup.csv') data = pd.merge(signup, items, on='item_id', how='inner') # 存在项目无人报名的情况,使用inner与left效果相同 print(data.groupby(['item_name'])['employee_id'].count())