[Numpy-discussion] Selecting columns of a matrix

Keith Goodman kwgoodman at gmail.com
Tue Jun 20 22:04:24 CDT 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