[Numpy-discussion] Deleting a row from a matrix

Keith Goodman kwgoodman at gmail.com
Fri Aug 25 13:58:06 CDT 2006


How do I delete a row (or list of rows) from a matrix object?

To remove the n'th row in octave I use x(n,:) = []. Or n could be a
vector of rows to remove.

In numpy 0.9.9.2813 x[[1,2],:] = [] changes the values of all the
elements of x without changing the size of x.

In numpy do I have to turn it around and construct a list of the rows
I want to keep?




More information about the Numpy-discussion mailing list