Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

tableInsert语法问题

下面是DolphinDB database 流数据教程中摘录的代码:

share streamTable(10000:0,`timestamp`temperature, [TIMESTAMP,DOUBLE]) as pubTable
vtimestamp = 1..100
vtemp = norm(2,0.4,100)
tableInsert(pubTable,vtimestamp,vtemp)

其中tableInsert有三个参数:pubTable,vtimestamp,vtemp。但在help文档中,其语法为:

tableInsert(X, Y)

其中参数Y可以是一个表或一个元组。上述例子中调用方法符合这个语法吗?这是对元组作为函数参数时的写法?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

这种参数是元组用法, tableInsert(t, ([31,32,33], [41,42,43])), 其实跟多个vector tableInsert(t, [31,32,33], [41,42,43])的原理上是一致的。在DolphinDB中,多个vector其实也是一个元组,比如x = ([1, 2, 3], [4, 5, 6]),x的类型就是元组。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...