【己解决】求代码读取指定行对应的数字
本帖最后由 keshun 于 2020-7-1 22:01 编辑open high low close volume MA_10 MA_20
1 9717.59834.29680.99759.2 69250.06168435 NaN NaN
2 9759.3 9999 95009522.6109463.51154308 NaN NaN
3 9522.69566.39056.29418.2 82493.28314455 NaN NaN
4 9418.29488.59301.89436.4 60685.84440805 NaN NaN
5 94369494.89309.19418.3 56135.01126463 NaN NaN
6 9418.39429.58910.49296.2 64881.99571136 NaN NaN
7 9296.29592.29281.39452.7 65942.38137758 NaN NaN
8 9452.8 95669369.29399.8 69108.10358129 NaN NaN
9 9399.8 9486 92319385.8 69546.26314103 NaN NaN
109386.5 9438 92409383.5 78708.898828249447.27 NaN
119383.59386.49172.19258.9 87117.479781149397.24 NaN
129258.9 94209240.79372.5 85171.628906089382.23 NaN
139373.19506.8 92769491.1 73702.433775569389.52 NaN
149491.29786.1 94749693.2 87451.292301799415.20 NaN
159693.29695.59205.19250.0 67853.282889089398.37 NaN
169249.69340.99007.49238.8 69483.437337319392.63 NaN
179238.99340.1 90469150.2 66812.378807889362.38 NaN
189150.99215.99091.69131.9 35669.095476349335.59 NaN
199131.99176.9 88189158.2 36168.752635899312.83 NaN
209158.9 9190 90289123.8 30741.211466489286.869367.065
219123.99235.59063.79176.7 43827.291491759278.649337.940
求代码读取第21行对应的数字MA_10:9278.64MA_20:9337.940 将你的数据保存为csv格式,然后运行这段代码
import numpy as np
import pandas as pd
f=pd.read_csv('data.csv')
print(f['MA_10']) # 第21行,因为python是从0开始计数
print(f['MA_20'])
请在目标楼层设置最佳答案。
页:
[1]