how do i go about getting the last two rows in a group?
q)show t:flip a
b!(1 1 2 3 3 3;til 6);
a b
1 0
1 1
2 2
3 3
3 4
3 5
q)select[-2] by a from t
a| b
-| -
2| 2
3| 5
q)select b by a from t
a| b
-| -----
1| 0 1
2| ,2
3| 3 4 5
the result i’d like is:
a b
1 0
1 1
2 2
3 4
3 5
thanks,
jack
You may find idxs first:
t raze value exec 2 sublist i by a from t
WBR, Andrey Kozyrev.
???, 31 ??? 2015 ?., 11:49:43 UTC+3 ??? effbiae ???:
how do i go about getting the last two rows in a group?
q)show t:flip a
b!(1 1 2 3 3 3;til 6);
a b
1 0
1 1
2 2
3 3
3 4
3 5
q)select[-2] by a from t
a| b
-| -
2| 2
3| 5
q)select b by a from t
a| b
-| -----
1| 0 1
2| ,2
3| 3 4 5
the result i’d like is:
a b
1 0
1 1
2 2
3 4
3 5
thanks,
jack