如何使用不同长度的不同数据在kdb中创建表?
当前正在获取长度错误。如何使用不同长度的不同数据在kdb中创建表?,kdb,Kdb,当前正在获取长度错误。 我遗漏了什么?由于每列的条目数不一致,因此解组失败,即区域有3个条目,人数有2个条目 count times:102 count area:3 count no.of_people:2 t:ungroup([]time:times;area:(count [times])#enlist area;no.of_people:count[times]#enlist no.of_people ) 从您的描述中不清楚您想要的输出是什么,但是如果您从列声明中删除登记,则会返回一
我遗漏了什么?由于每列的条目数不一致,因此
解组失败,即区域有3个条目,人数有2个条目
count times:102
count area:3
count no.of_people:2
t:ungroup([]time:times;area:(count [times])#enlist area;no.of_people:count[times]#enlist no.of_people )
从您的描述中不清楚您想要的输出是什么,但是如果您从列声明中删除登记
,则会返回一个表
q)times:102?.z.t
q)area:`area1`area2`area3
q)no.of_people:10 20
q)([]time:times;area:(count [times])#enlist area;no.of_people:count[times]#enlist no.of_people)
time area no.of_people
-------------------------------------------
19:01:02.988 area1 area2 area3 10 20
16:10:13.387 area1 area2 area3 10 20
00:42:09.536 area1 area2 area3 10 20
15:13:03.964 area1 area2 area3 10 20
08:35:51.109 area1 area2 area3 10 20
..
否则,要使初始解组工作,您需要确保列每行具有相同数量的条目(每行具有一个条目的列是“向量展开的”)
取消分组
失败,因为每列的条目数不一致,即区域
有3个条目,人数
有2个条目
count times:102
count area:3
count no.of_people:2
t:ungroup([]time:times;area:(count [times])#enlist area;no.of_people:count[times]#enlist no.of_people )
从您的描述中不清楚您想要的输出是什么,但是如果您从列声明中删除登记
,则会返回一个表
q)times:102?.z.t
q)area:`area1`area2`area3
q)no.of_people:10 20
q)([]time:times;area:(count [times])#enlist area;no.of_people:count[times]#enlist no.of_people)
time area no.of_people
-------------------------------------------
19:01:02.988 area1 area2 area3 10 20
16:10:13.387 area1 area2 area3 10 20
00:42:09.536 area1 area2 area3 10 20
15:13:03.964 area1 area2 area3 10 20
08:35:51.109 area1 area2 area3 10 20
..
否则,要使初始解组工作,您需要确保列每行具有相同数量的条目(每行具有一个条目的列是“向量展开的”)