题解 | #统计运动会项目报名人数(二)#
统计运动会项目报名人数(二)
https://www.nowcoder.com/practice/737d224c9cce482fb56ff812d04e79ab
import pandas as pd
import numpy as np
items = pd.read_csv("items.csv", sep=",")
signup = pd.read_csv("signup.csv", sep=",")
merged = pd.merge(
items,
signup,
how="inner",
on="item_id",
left_on=None,
right_on=None,
left_index=False,
right_index=False,
sort=True,
suffixes=("_x", "_y"),
copy=True,
)
print(
merged
.groupby("item_name")["employee_id"]
.count()
)

查看18道真题和解析