python数据分析用什么笔记本好_如何用python做数据分析

数据转置使用T方法,

# Transpose data

print df.T

# OUTPUT

0 1 2 3 4 5 6 7 8 9

Abra 1243 4158 1787 17152 1266 5576 927 21540 1039 5424

Apayao 2934 9235 1922 14501 2385 7452 1099 17038 1382 10588

Benguet 148 4287 1955 3536 2530 771 2796 2463 2592 1064

Ifugao 3300 8063 1074 19607 3315 13134 5134 14226 6842 13828

Kalinga 10553 35257 4544 31687 8520 28252 3106 36238 4973 40140

... 69 70 71 72 73 74 75 76 77

Abra ... 12763 2470 59094 6209 13316 2505 60303 6311 13345

Apayao ... 37625 19532 35126 6335 38613 20878 40065 6756 38902

Benguet ... 2354 4045 5987 3530 2585 3519 7062 3561 2583

Ifugao ... 9838 17125 18940 15560 7746 19737 19422 15910 11096

Kalinga ... 65782 15279 52437 24385 66148 16513 61808 23349 68663

78

Abra 2623

Apayao 18264

Benguet 3745

Ifugao 16787

Kalinga 16900

Other transformations such as sort can be done using sort attribute. Now let's extract a specific column. In Python, we do it using either iloc or ix attributes, but ix is more robust and thus I prefer it. Assuming we want the head of the first column of the data, we have

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值