gp=df.groupby(['user_id','item_id']).sum().reset_index()
print(gp.head())
gp = df.groupby(['user_id', 'item_id']).agg(['sum','count']).reset_index()
print(gp.head())
pandas groupby 作用多个函数
猜你喜欢
转载自blog.csdn.net/weixin_40161254/article/details/87969116
今日推荐
周排行