Reputation: 19466
Let's say I've got a list l
:
l: til 10
I want to show all values <3
.
I tried this:
l . (l<3)
and
l[l<3]
But neither work. How should I do it?
Upvotes: 1
Views: 1255
Reputation: 126
You can do this through the use of the where keyword. The where keyword will return the indices of your list that meet your criteria.
To use your example:
q)l:til 10;
q)l[where l<3]
0 1 2
Upvotes: 2
Reputation: 3179
I think where
is what you're looking for here.
q)l:til 10
q)l where l<3
0 1 2
Upvotes: 2