可以通过dolphindb的lj函数实现重置索引。
如果重置的索引标签在原 表 中不存在,那么该标签对应的元素值将全部填充为 NULL。
如原始表如下
tb=table(sort(take(09:30:00+0..6*1200,10)) as time,take(`100000`600000,10) as code,rand(10.,10) as price)
需要按如下的时间对每只code重置索引
total_time=09:30:00+0..12*600
通过lj函数连接如下:
total_index=table(take(total_time,2*size(total_time)) as time,sort(take(`100000`600000,2*size(total_time))) as code) tb=lj(total_index,tb,`time`code)