Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

take with axis=1 from matrix with matrix indices gives row instead of column (Trac #1307) #1905

Open
thouis opened this issue Oct 19, 2012 · 3 comments

Comments

@thouis
Copy link
Contributor

thouis commented Oct 19, 2012

Original ticket http://projects.scipy.org/numpy/ticket/1307 on 2009-11-28 by @thouis, assigned to unknown.

from numpy import *
version
'1.3.0.dev5934'
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]])

@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

@thouis wrote on 2009-11-28

Sorry, forgot to quote...

>>> 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]])

@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

@mwiebe wrote on 2011-03-25

Matrix does have some odd behaviors, not sure what a good way to fix it is though.

@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

Milestone changed to Unscheduled by @mwiebe on 2011-03-25

certik pushed a commit to certik/numpy that referenced this issue Nov 14, 2012
Also clean up the logic behind handling infs.
Squashed backport of 3503c5f..aea76b8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants