从对象转换为比特币时间序列分析后缺少日期时间行

问题描述 投票:0回答:0

我试图将我的 csv 文件的列(日期)从对象(2014/09/17)转换为日期时间(2014-09-17)但是当我从它开始的地方到 2014 年底(2014- 12-31),看起来日期时间缺少一些行,因为我只有 78 行而不是 105 行,而且 2014 年的折线图一团糟 XD。我在下面附上了图片,所以你可以看到一切。

这是我用来将对象转换为日期时间的代码

maindf['日期'] = pd.to_datetime(maindf['日期'],format='%Y-%m-%d')

y_2014 = maindf.loc[(maindf['日期'] >= '2014-09-17') & (maindf['日期'] < '2014-12-31')]

y_2014.drop(y_2014[['Adj Close','Volume']],axis=1)

我该如何解决这个问题?

Input and output after I converted to datetime Year 2014 Line Chart after the converted datetime 2014 until today after the converted datetime, i still need to check the other years as well, but it looks like there are missing rows there as well

我期望有 105 行 Datetime 并且不少于。线图很好。

datetime time-series data-science bitcoin timeserieschart
© www.soinside.com 2019 - 2024. All rights reserved.