# 如果列很多就不好看,我们就可以选择看前三多的item即可defthird_item(part_data):
third_kill_map = part_data.sort_values(['num'], ascending=False)[:3]
d_third_kill_map ={key: value for key, value in third_kill_map[['item','num']].values}return d_third_kill_map
df_stat.groupby(['user']).apply(third_item).reset_index()