pandas 分组,显示去重后列表元素和个数显示
uniquenuniqueaggs={'day_time':['nunique','unique']} gp=df.groupby(['user_id','subject_id']).agg(aggs)print(gp) day_time nunique