https://stackoverflow.com/questions/39273441/flatten-pandas-pivot-table
Flatten pandas pivot table
This is a follow up of my question. Rather than a pivot table, is it possible to flatten table to look like the following: data = {'year': ['2016', '2016', '2015', '2014', '2013'], 'country':[...
stackoverflow.com
df_test_01 = pd.pivot_table( df_test , index =['part_datecd'] , columns='good_cls1cd', values=['ntsal_amt','sal_qty'])
# index : 행
# columns : 컬럼으로 들어갈 컬럼명
# value : 값
df_test.columns = list(map("_".join, df_test_01.columns))
'언어 꿀Tip > Python 꿀tip!' 카테고리의 다른 글
07_01_08. seaborn x축 날짜 변경 (시계열 형태) (0) | 2021.02.09 |
---|---|
07_01_07. aws 한글 폰트 지정 (0) | 2021.02.08 |
07_01_09. index filtering (0) | 2021.02.08 |
07-01-05. [ ]없이 list string (0) | 2021.01.25 |
07-01-04. 엑셀파일 저장하기 in python (0) | 2021.01.04 |