4 ms·
You made me realize, I think of the brackets as saying "where". vec[2] is vec where the index is 2. vec[vec > 5] is vec where the entries of vec are greater tha
by fantod 6y ago
You made me realize, I think of the brackets as saying "where". vec[2] is vec where the index is 2. vec[vec > 5] is vec where the entries of vec are greater than 5, etc.
- beagle3 6y agoK makes this explicit with the ‘where’ function which converts a Boolean array into the list of indices of true values. Thus, x[4 5 6] is index access (“at”); also x@4 5 6 x[&x>3] is “x at where x is greater than 3” ; can also be written x@&x>3