首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DolphinDB python API:在DolphinDB DataFrame中使用timestamp类型

DolphinDB python API:在DolphinDB DataFrame中使用timestamp类型
EN

Stack Overflow用户
提问于 2021-11-25 04:11:37
回答 1查看 19关注 0票数 0

我在DolphinDB中创建了一个streamtable,在类型'TIMESTAMP‘中定义了一个列类型,而time只能在pandas DataFrame中的类型datetime64ns中定义,该类型将在DolphinDB中转换为nanotimestamp。如果将数据帧直接插入到streamTable中,则可能会错误处理时间。除了使用SQL语句转换数据帧的类型之外,还有没有其他方法来处理这个问题?

EN

回答 1

Stack Overflow用户

发布于 2021-11-26 07:07:13

Python API中对象tableAppenderappend方法将本地DataFrame附加到内存中的表或分区表中。在这个过程中,DolphinDB会自动转换时态类型。

tableAppender语句的用法如下:

代码语言:javascript
复制
tableAppender(dbPath="", tableName="", ddbSession=None, action="fitColumnType")

dbPath: path of the distributed database. Fill "" if it is an in-memory table.

tableName: name of the table

ddbSession: session handle that has connected to the DolphinDB server.

action: assigned action when appending the table. Currently only "fitColumnType" action is supported, indicating the conversion of time column type.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70105713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档