Kdb 如何创建具有相同元素的长度为x的列表?

Kdb 如何创建具有相同元素的长度为x的列表?,kdb,Kdb,我想在q/kdb中创建一个可变长度x的列表,其中包含相同的元素e。例如: x:4; e:`this; expected_result:`this`this`this`this Take是您要找的: 您可以使用# 使用功能: q) x:4 q) e:`this q) x#e 正如大家所提到的,#是单一情况下的最佳解决方案。如果您想将多个项目复制到一个更大的列表中,那么where可以很好地实现这一点 q)`this`that where 4 2 `this`this`this`this`

我想在q/kdb中创建一个可变长度
x
的列表,其中包含相同的元素
e
。例如:

x:4;
e:`this;
expected_result:`this`this`this`this

Take是您要找的:


您可以使用
#

使用功能:

 q) x:4
 q) e:`this
 q) x#e

正如大家所提到的,
#
是单一情况下的最佳解决方案。如果您想将多个项目复制到一个更大的列表中,那么
where
可以很好地实现这一点

q)`this`that where 4 2
`this`this`this`this`that`that
对于一些多样性-
(`this`this)1
 q) x:4
 q) e:`this
 q) x#e
q)`this`that where 4 2
`this`this`this`this`that`that