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

Ensure that indices are suitable for numpy.take. #92

Closed
wants to merge 1 commit into from

Conversation

lamblin
Copy link
Member

@lamblin lamblin commented Oct 4, 2011

On a 32-bit machine, numpy.take may refuse to use int64 arrays for indices.

On a 32-bit machine, numpy.take may refuse to use int64 arrays for indices.
dtype.num == numpy.dtype(numpy.int64).num):
# If both types have the same string description (byte order, basic
# type, and number of bytes), then it is safe to return a view.
if (dtype.str == rval.dtype.str):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the docstring of _asarray, more precisely the part that says:

Currently, this issue has only been causing trouble when the target
data type is 'int32' or 'int64', on some computers. As a result, we
silently fix it only in this situation: if a type mismatch is detected
with another data type, an exception is raised (if that happens, then this
function may need to be modified to also handle this other data type).

@dwf
Copy link
Member

dwf commented Oct 7, 2011

I'm going to merge this and fix the typo, and open a ticket for @lamblin to get the docstring.

@dwf
Copy link
Member

dwf commented Oct 7, 2011

Manually merged as 349f7f6

@dwf dwf closed this Oct 7, 2011
@dwf
Copy link
Member

dwf commented Oct 7, 2011

Correction: 5e6ce10a3.

@dwf dwf mentioned this pull request Feb 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants