I'm trying to create a splayed table with a symbol column using pyq. In q I would set the table by enumerating the symbol column with .Q.en...
:splay/ set .Q.en[`:splay;]([]a:`x`y`z; b:1 2 3)
I tried a few variations of the following...
q.set(':splay/', q('.Q.en')('!', ["Name", "Ask", "Bid", "Last", "Vol", "Time"], [K.symbol([]), K.float([]), K.float([]), K.float([]), K.float([]), K.timestamp([])]).flip)
But it throws the following rank error: _k.error: rank.
What is the proper syntax for this in pyq?
First, your q code is incorrect. The function
will place the
symfile inside the splay table and this is not what you want. Instead, thesymfile should be saved in the top database directory (dbin the code below) next to thesplaytable.The same code can be written in pyq as