0
Category Cat2 average
Beauty/Wellness/Healthcare 1 54.50
2 53.25
3 48.00
4 57.57
5 51.33
6 18.50
7 16.00
데이터 프레임, 다중 레벨이 있습니다. 두 번째 수준을 간단한 열로 변환해야합니다. 가능할까요? unstacking
은 1에서 7까지의 열을 만듭니다.서브 레벨을 단일 열로 변환
추가 사항 : 그룹 이름의 이름을 바꿀 수 있습니까 (레벨 0과 1에서)?
TNX합니다. 그러나 df.reset_index ([ 'Cat2'])는 어떻게 든 'df.index'에 색인의 중복을 생성하므로 카테고리별로 재 그룹화 할 수 없습니다. – NoIdeaHowToFixThis
'df.info()'와'df.index'를 게시하십시오. – unutbu
색인 (u'Beauty/Wellness/Healthcare ', u'Beauty/Wellness/Healthcare', u'Beauty/Wellness/Healthcare ', u'Beauty/Wellness/Healthcare', u'Beauty/Wellness/Healthcare ', u) '뷰티/웰니스/헬스 케어', u'Food & Drink, u'Food & Drink, u'Food & Drink, u'Food & Drink, u'Food & Drink, u'Food & Drink 'u'Food & Drink', u'Other ', u'Other', u''other ', u'other', u''Other ', u''other', u''other ', u''other', u 'Other', u'Other '], dtype ='object ') – NoIdeaHowToFixThis