【发布时间】:2017-09-29 13:10:11
【问题描述】:
为什么我在“ACTION”列中得到 NaN? 我得到这个结果对我来说似乎很奇怪。我试过使用 ignore_index = True 并且它有一个频率错误。
C H L O OI V WAP ACTION
datetime
2017-03-14 00:52:00 8.25 8.25 8.19 8.21 302.0 1769.0 8.22 NaN
2017-03-13 23:54:00 8.09 8.10 8.09 8.10 6.0 65.0 8.10 NaN
2017-03-14 01:03:00 8.29 8.32 8.28 8.29 175.0 1084.0 8.30 NaN
2017-03-14 00:03:00 8.15 8.15 8.14 8.15 13.0 50.0 8.15 NaN
2017-03-13 23:57:00 8.13 8.13 8.12 8.12 3.0 6.0 8.12 NaN
我想得到-
C H L O OI V WAP ACTION
datetime
2017-03-14 00:52:00 8.25 8.25 8.19 8.21 302.0 1769.0 8.22 100
2017-03-13 23:54:00 8.09 8.10 8.09 8.10 6.0 65.0 8.10 200
2017-03-14 01:03:00 8.29 8.32 8.28 8.29 175.0 1084.0 8.30 300
2017-03-14 00:03:00 8.15 8.15 8.14 8.15 13.0 50.0 8.15 400
2017-03-13 23:57:00 8.13 8.13 8.12 8.12 3.0 6.0 8.12 500
buy_stp = pd.Series([100,200,300,400,500],name= 'ACTION')
print(buy_stp)
df10 = pd.concat([df_concat_results,
buy_stp],
axis=1,
join_axes=[df_concat_results.index])
print(df10)
【问题讨论】:
标签: python-3.x pandas concat