3
"""
Example of using Panda
"""
from pandas import DataFrame
d=DataFrame(index=[(i,j) for i in range(1,7) for j in range (1,7)], columns=['sm','d1', 'd2', 'pd1', 'pd2', 'p'])
d.d1=[i[0] for i in d.index]
d.d2=[i[1] for i in d.index]
d.sm = map(sum, d.index)
d.head(20)
我在熊貓一個初學者,我想創建的元組的總和的一列,但是這是我得到:加元組指標
sm d1 d2
( 1,1)<地圖對象在0x7f ... 7438> | 1 | 1 |在0x7f的... 7438
(1,2)<地圖對象> | 1 | 2 |在0x7f的... 7438
(1,3)<地圖對象> | 1 | 3 |在0x7f的... 7438
(1,4)<地圖對象> | 1 | 4 |在0x7f的... 7438
(1,5)<地圖對象> | 1 | 5 |
我使用的地圖功能錯了嗎?這是python3的問題?提前致謝。
YES。非常感謝! – MoneyBall
@MoneyBall,歡迎您:) – MaxU