Reputation: 19486
I frequently have to explore the actual data by looking through it.
The problem I encounter is:
til 100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ..
q)
Everything gets truncated in the REPL.
Is there an easy way to explore data in KDB? (I'm using the REPL in combination with vim-cmdline
)
Upvotes: 0
Views: 155
Reputation: 13657
Similar to Seans suggestion, you can also use cut
to see more of a list:
q)20 cut til 100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
It can be useful sometimes but it's situational.
Same goes for using #
to reshape:
0N 20#til 100
20 0N#til 100
Upvotes: 2
Reputation: 1593
Out of the box KDB+ doesn't offer this ability.
If you want to display more data on the screen can expand your console size (up to a certain limit) via the \c
system command or -c
command line parameter
https://code.kx.com/q/basics/syscmds/#c-console-size
You could also use in-built functions like _
(drop), sublist
, or ?
(find) to locate and display particular data of interest.
q)l:til 100
q)(-5+l?40;11) sublist l // Show 5 records either side of 40
There are also some IDEs for KDB+ that might help:
http://www.qinsightpad.com/
https://github.com/CharlesSkelton/studio
https://code.kx.com/developer/
Upvotes: 2