[SciPy-dev] is this a bug (take with indices in a matrix)
Charles R Harris
Thu Nov 26 18:54:11 CST 2009
On Thu, Nov 26, 2009 at 5:40 PM, Thouis (Ray) Jones <email@example.com>wrote:
> >>> from numpy import *
> >>> q = matrix(arange(9).reshape((3,3)))
> >>> take(q, matrix([]), axis=0)
> matrix([[0, 1, 2]])
> >>> take(q, matrix([]), axis=1)
> matrix([[0, 3, 6]])
> Expected behavior for the last expression:
> >>> take(q, , axis=1)
Bug or feature could be the subject of much discussion, but it is definitely
a wart. What looks to be happening is a two step thing. First the column is
taken ndarray wise, resulting in a 1d array, which is then converted using
the default 1d -> row for matrix conversions.
I think it could be fixed, but the whole problem with the current matrix
class is that fixing all these warts starts to intrude on the base ndarray
You should raise the issue on the numpy mailing list, it's time for another
discussion of the matrix class.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev