0
필자는 피벗 맨 위에 총 행을 추가하려고합니다. 그러나 연결을 시도 할 때 오류가 발생했습니다. I처럼 그것의 전체가 여기에 출력pandas concat is not possible 오류가 발생했습니다.
[1 rows x 7 columns]
>>> pc = [totals_frame, table]
>>> concat(pc)
가입
>>> totals_frame
Vcountry 1 2 3 4 5 6 7
totalCount 204 87 151 142 135 99 203
피벗 테이블 그게
>>> table
Weight
Vcountry 1 2 3 4 5 6 7
V20001
1 86 NaN NaN NaN NaN NaN 92
2 41 NaN 71 40 50 51 49
3 NaN 61 60 61 60 25 62
4 51 NaN NaN NaN NaN NaN NaN
5 26 26 20 41 25 23 NaN
[5 rows x 7 columns]
: 여기
reindex_items
copy_if_needed=True)
File "C:\Python27\lib\site-packages\pandas\core\index.py", line 2887, in reindex
target = MultiIndex.from_tuples(target)
File "C:\Python27\lib\site-packages\pandas\core\index.py", line 2486, in from_tuples
arrays = list(lib.tuples_to_object_array(tuples).T)
File "inference.pyx", line 915, in pandas.lib.tuples_to_object_array (pandas\lib.c:43656)
TypeError: object of type 'long' has no len()
합니까를'? 'table = table [ 'Weight']'시도한 다음 연결을 수행하십시오. – TomAugspurger