【发布时间】:2019-07-04 16:35:15
【问题描述】:
这是时间戳列:
TIME
2018-03-02 11:57:37
2018-03-12 10:36:16
2018-03-29 12:02:21
2018-03-23 16:37:08
2018-03-09 22:22:28
.
.
我尝试合并并遇到以下错误。
TypeError: '<' not supported between instances of 'datetime.datetime' and 'int'
所以我试图找到一个具有不同数据类型的列,如代码下,但没有成功。
for i in range(len(ds)):
if type(ds['TIME'].loc[i]) != type(ds['TIME'].loc[1]) :
ds = ds.drop(i)
# type(ds['TIME'].loc[1]) was confirmed that it was a timestamp type
我该如何解决这个问题?
如果您能给我一些好的建议,我将不胜感激。
这是我尝试的。
raw_data = pd.merge_ordered(ds,ds2)
#ds2 is similar data like ds
+我认为这可能是 db 中的解析问题。
【问题讨论】:
标签: python dataframe timestamp