[Numpy-discussion] Selecting columns of a matrix (original) (raw)
Alan G Isaac aisaac at american.edu
Wed Jun 21 22:08:50 EDT 2006
- Previous message (by thread): [Numpy-discussion] Selecting columns of a matrix
- Next message (by thread): [Numpy-discussion] Selecting columns of a matrix
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Alan G Isaac wrote:
M.transpose()[V>0] If you want the columns as columns, you can transpose again.
On Wed, 21 Jun 2006, Keith Goodman apparently wrote:
I can't get that to work when M is a n by m matrix:
The problem is not M being a matrix. You made V a matrix (i.e., 2d). So you need to ravel() it first.
M.transpose()[V.ravel()>0]
hth, Alan Isaac
- Previous message (by thread): [Numpy-discussion] Selecting columns of a matrix
- Next message (by thread): [Numpy-discussion] Selecting columns of a matrix
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]