But there is one more thing that came up, and that has to do with the selection of elements from an array. I wasn't aware that you can do indexing by a test that returns a boolean vector in numpy, but you can. In R, it's common to see something like this. Here is a matrix m. We can leave a row out by "-":
The test m[,1] > 2 asks for all rows in which the first column is greater than 2:
Note: I screwed this up in the original example. We use the selector to get those rows:
How would you do this in Python with numpy?
It works!