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
dtype of np.random.choice differs with presence of p on windows #9867
I'd expect the output dtype to be consistent whether p is present or absent. Since the dtype of arange on win32 is int32, the int64 dtype output is probably the incorrect one.
Activity
bashtage commentedon Oct 18, 2017
This difference occurs at
https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/mtrand.pyx#L1155
since
searchsortedreturnsint64irrespective of platform.bashtage commentedon Oct 18, 2017
The return type for
searchsortedisNPY_INTPhere:numpy/numpy/core/src/multiarray/item_selection.c
Line 1732 in c2372af
ENH: ENsure choice uses a consistent return type
ENH: Consistent return type for choice
bashtage commentedon Jun 1, 2019
@mattip This is fixed in Generator but not in RandomState. Should it be fixed in RandomState or left as it was in 1.16?
mattip commentedon Jun 1, 2019
I guess this is a bug, and should be fixed, unless it breaks something else.