[SciPy-dev] is this a bug (take with indices in a matrix)

Thouis (Ray) Jones thouis@broad.mit....
Thu Nov 26 18:40:08 CST 2009


>>> from numpy import *
>>> q = matrix(arange(9).reshape((3,3)))
>>> take(q, matrix([[0]]), axis=0)
matrix([[0, 1, 2]])
>>> take(q, matrix([[0]]), axis=1)
matrix([[0, 3, 6]])

Expected behavior for the last expression:
>>> take(q, [0], axis=1)
matrix([[0],
        [3],
        [6]])


More information about the SciPy-Dev mailing list