unpivot时提示Not allowed to create void vector是什么原因?

我在DolphinDB database中想把多列的表数据转换成一列,代码如下:

def f1(x)
{
  x.substr(3);
}
cColCount =tTable0.sym.count()
syms1 = tTable0.columnNames()[1:(cColCount+1)]
tTable1 = tTable0.unpivot(`sym,  syms1 , f1)

执行到unpivot这行时报错:

Not allowed to create void vector

请问这是什么原因?

请先 登录 后评论

1 个回答

Jason Tang - 时序数据库技术支持

函数f1少了个return

def f1(x){
  return x.substr(3);
}
cColCount =tTable0.sym.count()
syms1 = tTable0.columnNames()[1:(cColCount+1)]
tTable1 = tTable0.unpivot(`sym,  syms1 , f1)


请先 登录 后评论
  • 1 关注
  • 0 收藏,1146 浏览
  • Xinhai Tang 提出于 2021-05-11 10:36