-
kdb equivalent of pandas groupby
Example:
trade:([]time:`time$();sym:`symbol$();price:`float$();size:`int$());
`trade insert(09:30:00.000;`a;10.75;100);
`trade insert(09:31:00.000;`a;11.75;100);
`trade insert(09:32:00.000;`a;13.2;100);
`trade insert(09:30:00.000;`b;100.75;100);
`trade insert(09:31:00.000;`b;106.95;100);
`trade insert(09:32:00.000;`b;123.95;100);I would like to calculate the change in price over time for each sym:
select sym, time, change:price-prev price by sym from tradeIt seems the above query is not working well. How should I modify it?
Log in to reply.