读取数据出错该怎么处理

test0
ts_code trade_date open high low close pre_close
002262,20200609,126.7688,139.26,126.7688,139.26,126.3
002262,20200608,120.5232,129.4696,117.4848,126.6,119.0884
002262,20200605,117.8224,122.2112,116.5564,119.0884,117.1472
002262,20200604,117.316,117.4848,115.206,117.1472,117.2316
002262,20200603,117.1472,119.1728,116.05,117.2316,117.316
002262,20200602,118.582,119.5948,115.8812,117.316,118.8352
002262,20200601,116.5564,119.6792,116.3876,118.8352,116.05
002262,20200529,114.8684,117.8224,114.5308,116.05,115.7124
002262,20200528,119.3416,119.3416,113.518,115.7124,119.426
002262,20200527,125.1652,125.5028,118.0756,119.426,125.9248
002262,20200526,125.2496,126.7688,122.8864,125.9248,125.0808
002262,20200525,118.0756,126.2624,116.9784,125.0808,117.4004
002262,20200522,121.1984,122.2112,116.7252,117.4004,120.6076
002262,20200521,117.316,124.2368,116.5564,120.6076,116.3032
002262,20200520,119.6792,121.2828,114.784,116.3032,119.5104
002262,20200519,121.2828,122.802,117.9068,119.5104,119.9324
002262,20200518,118.8352,121.6204,117.738,119.9324,119.004

test1
ts_code,date_start,date_end,close
002262,20200602,20200608,170.0299
002262,20190519,20200528,85.5816

读取test0的位置在test1里,该怎么表示才真确
结果
test0= test0.mask(test0['trade_date'] == test1.loc['date_start': 'date_end'])
Unnamed: 0 ts_code trade_date open high low close pre_close
0 NaN NaN NaT NaN NaN NaN NaN
1 NaN NaN NaT NaN NaN NaN NaN

回答

你是要合并还是取出来就行了

以上是读取数据出错该怎么处理的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>