df_4w_ag = df_4w.groupby(["origin_bizpl_cd" , "goods_cd"] ).agg({"bg_purch_qty": [("sum_4w", "sum"), ("mean_4w", "mean"), ("max_4w", "max")], "bg_purch_qty_yn":[("count_4w", "sum")]}).droplevel(0, axis=1).reset_index()
'언어 꿀Tip > Python 꿀tip!' 카테고리의 다른 글
07_01_33. 한번에 lag 여러개 생성 (0) | 2021.04.26 |
---|---|
07_07_32. group별로 ts time series 한번에 만들기 (0) | 2021.04.26 |
07_01_30. convert multi index to single index (Series) (0) | 2021.04.12 |
07_01_29. isocalendar() 일자의 주차 구하기 weeknum (0) | 2021.04.12 |
07_01_28. 오른쪽 특정 문자 삭제하기 (0) | 2021.04.09 |