-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
DOC: numpy.random.sample and numpy.random.random_sample #10587
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
Comments
This is show this way because: >>> np.random.random_sample
<function RandomState.random_sample>
>>> np.random.sample
<function RandomState.random_sample> I think flipping the alias would be reasonable |
|
@rkern isn't it better to deprecate |
IMO it is almost never worth it to remove API to achieve consistency since this will break existing code and documentation (e.g., tutorials). If matching |
xref #13163 . This is fixed in the randomgen branch, subject to dropping |
Also contains docstring pointers for ranf and sample. |
Expose alias that have correct docstrings closes numpy#10587
I just noticed in the docs that the page for
numpy.random.sample
indicates that the function should be called asnumpy.random.random_sample
. I understand that this may just indicate that the function may be called as eithersample
orrandom_sample
, but it does come across as a mistake when first viewing the page. Perhaps make it more explicit thatrandom_sample
is an alias ofsample
? Or is this the accepted practice for functions that have aliases?The text was updated successfully, but these errors were encountered: