You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
numpy.take fails with int64 dtype on i386 architecture #11696
>>> x.take(index)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
Activity
eric-wieser commentedon Aug 9, 2018
Arguably this is by design. If you're indexing with a type bigger than
np.intp, then it's possible to overflow, and you don't want that.From that, it follows that you should really just use
np.intpto store indices. Internally, this may save a bunch of copies in numpy anywayrth commentedon Aug 9, 2018
OK, makes sense. Thanks @eric-wieser !