df_ff_01 = pd.pivot_table( df_ff , index =['part_datecd'] , columns='good_cls1cd', values=['ntsal_amt','sal_qty'])
df_ff_01.columns = list(map('_'.join, df_ff_01.columns))
# index에 지정된 column이 index화 되기 때문에 그걸 다시 column으로 변경시킴
df_ff_01.reset_index(level=0, inplace=True)
'언어 꿀Tip > Python 꿀tip!' 카테고리의 다른 글
07_01_40. matplotlib plot 크기 조정 (plot size) (0) | 2021.05.27 |
---|---|
07_01_39. matplotlib 그래프 이중축 graph 생성 및 축이름 (0) | 2021.05.27 |
07_01_35. local 환경에서 그래프(graph) 한글 깨짐 (0) | 2021.05.10 |
07_01_34. category 변수 다루기, handling (0) | 2021.04.28 |
07_01_33. 한번에 lag 여러개 생성 (0) | 2021.04.26 |