2

I want to create a table with a lot of columns in dolphidndb, but I can't find a convenient way?

If I use the t = table(size:capacity,names,types), when I have many many columns, it is not convenient to modify and add or delete some columns.

colNames = ["col1","col2","col3","col4","col5","col6","col7","col8" ...]

colTypes = [STRING,DOUBLE,INT,LONG,SYMBOL,LONG,DATE,TIME,TIMESTAMP ...]

t = table(100:0,colNames,colTypes)

Is there more convenient way to do this work?

PV8
  • 5,799
  • 7
  • 43
  • 87
pengfei
  • 61
  • 2

1 Answers1

0

The table function in DolphinDB has another way to organize columns.Instead of specifying a column name list and a column type list, one can specify columns one by one.

t= table(array(STRING, 0) as col1,
         array(DOUBLE, 0) as col2,
         ...
         )
Davis Zhou
  • 353
  • 4
  • 6