我有一个Pandas DataFrame
,它有11列,但我想将DataFrame从第1列而不是第0列拆分到第10列。我可以通过更复杂的方法实现它,而不是由Pandas
本身。如何使用DataFrame
支持的Pandas
方法?
数据是595行乘11列,我想得到:
>>> import numpy as np
>>> import pandas as pd
>>> train_data = pd.DataFrame(my_data, columns=my_columns)
>>> train_data
stockid prich_m1 prich_m3 prich_m6 \
1 000002.SZ 1.55755700445 0.861009772647 5.42726384781
2 000009.SZ 3.00223270244e-07 4.8010096027 4.46164511978
.. ... ... ... ...
.. ... ... ... ...
594 603699.SH 0.0491892903353 0.934596516371 0.0196757161342
595 603993.SH 0.83105321611 0.771692272102 2.02816558693
rsi mkt_cap held_by_ins found_own \
1 0.650879566982 153108876954.0 42.6353598479 14.9550575226
2 0.462085308057 19492802690.5 25.8866394448 5.31468116104
.. ... ... ... ...
.. ... ... ... ...
.. ... ... ... ...
594 0.482105263158 14580000000.0 3.98638909091 3.41028242424
595 0.559681697613 44416492093.8 90.0529786043 1.56995953686
debt_to_equity eps_rate share_out
1 4.4521 0.292628452536 11021632763.0
2 2.8257 -50.6773540796 1489669062.0
.. ... ... ...
.. ... ... ...
594 0.6798 1.48454654486 82500000.0
595 0.8822 10.3388360485 3279577050.0
[595 rows x 11 columns]
我想删除stockid
列并获取其余数据。