我在DolphinDB中有以下表格:
n=1000000
t1=table(rand(`a`b`c,n)as ID, rand(2017.08.16..2018.09.15,n) as date ,rand(10.0,n) as price)
我正在尝试做的是将表转置到一个面板数据中,所有日期都在一列中,例如:
date a b c
2017.08.16 1.1246 4.6269 2.3019
2017.08.17 7.8525 9.7178 2.916741
...
在DolphinDB中有没有一种有效的方法来做到这一点?
发布于 2020-12-21 04:43:48
您可以尝试这样做:
panel(t1.date,t1.ID,t1.price, 2017.08.16..2018.09.15)
另一种方式:
select price from t1 pivot by date,ID
https://stackoverflow.com/questions/65387034
复制相似问题