我正在使用Cassandra Python driver
,我创建了一个表,在表中有一列(称为date)被定义为timestamp
。我尝试从数据帧访问值,并使用这些值将行插入表中。与date对应的dataframe值的格式为(从PyCharm
调试模式捕获)
Timestamp('2006-09-29 00:00:00')
但我有以下错误
TypeError: Received an argument of invalid type for column "date". Expected: <class 'cassandra.cqltypes.DateType'>, Got: <class 'str'>; (DateType arguments must be a datetime, date, or timestamp)
表格定义为
^{pr2}$更新
问题是由于数据帧中有nat,在插入cassandra之前忘记删除它们。在
请尝试使用
datetime.datetime(2016,09,29)
相关问题 更多 >
编程相关推荐