在1.30.19.4及之后版本的 Python API 中,用户在使用 TableAppender 类的 append 方法写入数据时,可能会收到如下警告:UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access该警告并不会对程序执行造...
回答于 2023-06-08 17:48
如果是社区版,单节点内存上限是 8G,您的 csv 文件 1.2 G, 导入后类似变量 t 这种临时变量也占了内存,检查一下是否是临时变量和导入的数据加起来超过了 8G, 另外可以用 loadTextEx 直接导入分布式表,不需要先 loadText 再 append, 这样可以避免过大的中间表变量占用内存
回答于 2023-06-08 15:50
n = 100000records_from_old = table(rand(10000, n) as id, rand(100.0, n) as val)records_from_new = table(rand(11000, n) as id, rand(100.0, n) as val)timer re1=select * from records_from_old where not exists(select * from records_from_new where records_from_old.id in records_from_new.id) //466.652 mst...
回答于 2023-06-05 16:41
ols 目前不支持输入一个非满秩的矩阵,可以参考这个问答:https://ask.dolphindb.net/question/2423 判断一下输入的 XX 是否是满秩的矩阵。下个版本我们会做一个优化,允许 ols 输入一个非满秩的矩阵。
回答于 2023-06-02 17:07
sql((sqlCol(`date),sqlCol(code,ratios, `ret)),table ).eval() sqlCol 第一个参数为列名字符串,因此上述语句计算的是 table 中列名为 `000905 这列的 ratios。 sql((sqlCol(`date),sqlColAlias(<ratios(code)>,`ret)),table).eval() sqlColAlias 第一个参数以 metaCode 传入,根据表达式计算的是 table 中列...
回答于 2023-05-31 11:06
date1 = rand(getMarketCalendar("SSE",2023.01.01,2023.12.31), 100000).sort!() // 方法一: 循环遍历计算 re = array(DATE) timer for(d in date1){ re.append!(last(getMarketCalendar("SSE",weekBegin(d),weekEnd(d)))) } // 方法二:向量化计算 timer { mday = getMarketCalendar("SSE", 2023.01.01, 2023.12.31)...
回答于 2023-05-31 10:57
(1)可以通过 stretch 和 take 函数搭配实现: take(x.stretch(x.count()*2), x.count()) (2)通过 bar 函数实现: bar(x, 2, closed='right') / 2 (3)通过循环两两填充。与上述方法相比,优势是可以自己指定填充值: x = [1,2,3,4,5,6,7,8]re = matrix(cut(x, 2))fillValue = 1..4each(fill!{re}, 0..(re.cols()-...
回答于 2023-05-30 13:59
可以用 DolphinDB GUI 进行脚本编辑,或者安装 VScode 插件。参考 https://gitee.com/dolphindb/Tutorials_CN/blob/master/client_tool_tutorial.md 目前暂不支持代码 debug(下个发布版本会支持 VScode 的 debug 功能),用户登录的话直接调用函数 login 即可。
回答于 2023-05-30 11:21