what is rank in kdb ?

What is the rank in kdb mean ?

http://code.kx.com/wiki/Reference/QuestionSymbol

However, if the right argument is a general list then items of the left argument are matched with items of the right argument. For example,

q)u?(2 3;`ab)3 3

In this case Find matches items of the left argument with 2 3 and ab</tt>&nbsp;, not&nbsp;<tt style='"font-family:' monospace new>(2 3;ab).

? is rank sensitive; x?y can’t deal with mixed rank x. If rank x is n then x?y looks for objects of rank n-1. e.g.

2 3?2 3#til 6 / looks for rank 0 objects(0 1 2;4 5)?2 3#til 6 / looks for rank 1 objects

www.jsoftware.com/papers/j4apl1.htm#items

q)3 4#til 12

0 1 2 3

4 5 6 7

8 9 10 11


q)count [3 4#til 12]

3

Is there an APL ? (Rho) equivalent for q? 3 4

there’s no rho primitive in q.  q is distinct from j in that it allows ragged arrays

nothing preventing a rho lambda being defined.

>  ^ (0 1 2 3;4 5 6 7;8 9 10 11)

3 4

Used to work in k3

count each (0 1 2 3;4 5 6 7;8 9 10 11)

/4

count count  each (0 1 2 3;4 5 6 7;8 9 10 11)

3

a naive implementation of shape:

q)rho:{$[not 0>type x;count,.z.s first x;()]}

q)rho 3 2 1#1

3 2 1