How to quickly create an empty wide table in DolphinDB?

13 views Asked by At

Supposing the result of the createTimeSeriesEngine function contains more than 100 columns, is there an easy way to set an empty wide table as the outputTable?

1

There are 1 answers

0
dbaa9948 On

If the column names share a prefix or suffix (e.g. factor001-factor100) and have the same data type (e.g. DOUBLE), you can use table(1:0, "factor" + lpad(string(1..100), 3, "0"), take(DOUBLE, 100)) to quickly create an empty table with 100 columns.