-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
dtype of np.random.choice
differs with presence of p
on windows
#9867
Comments
This difference occurs at https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/mtrand.pyx#L1155 since |
The return type for numpy/numpy/core/src/multiarray/item_selection.c Line 1732 in c2372af
|
Ensure that choice uses int64 for all paths/platforms xref numpy/numpy#9867
Ensure that choice uses int64 for all paths/platforms xref numpy/numpy#9867
@mattip This is fixed in Generator but not in RandomState. Should it be fixed in RandomState or left as it was in 1.16? |
I guess this is a bug, and should be fixed, unless it breaks something else. |
Downcast from searchsorted on Windows to ensure int32 is returned closes numpy#9867
The dtype of the output of
np.random.choice
with a scalara
is different ifp
is provided on windows:I'd expect the output dtype to be consistent whether
p
is present or absent. Since thedtype
ofarange
on win32 isint32
, theint64
dtype output is probably the incorrect one.The text was updated successfully, but these errors were encountered: