[Numpy-discussion] Selecting columns of a matrix (original) (raw)

Keith Goodman kwgoodman at gmail.com
Tue Jun 20 23:04:24 EDT 2006


I have a matrix M and a vector (n by 1 matrix) V. I want to form a new matrix that contains the columns of M for which V > 0.

One way to do that in Octave is M(:, find(V > 0)). How is it done in numpy?



More information about the NumPy-Discussion mailing list