如何将字典转换为DolphinDB中的内存表?

问题描述 投票:0回答:1

例如,如何将字典

a = {"col1": 3, "col2":4}
转换为下表?

col1    col2
3       4
dictionary datatable dolphindb
1个回答
0
投票

如果字典的值是数组,您可以使用

transpose
函数将字典转换为表格,如下所示:

z=dict(`id`val,[`a`b`c,1 2 3]);
transpose(z);

在其他情况下,将字典的值转换为数组,然后使用

transpose
函数,如下例所示:

a = {"col1": 3, "col2":4}
enlist:E(a).transpose() 
© www.soinside.com 2019 - 2024. All rights reserved.