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

Remove alias in pandas docs for numpy.random.randn #147

Open
datapythonista opened this issue Aug 21, 2019 · 4 comments
Open

Remove alias in pandas docs for numpy.random.randn #147

datapythonista opened this issue Aug 21, 2019 · 4 comments
Labels

Comments

@datapythonista
Copy link
Member

See the discussion here: pandas-dev/pandas#28038 (comment)

In pandas we have a header variable that we inject at the top of all documentation pages. One of the things there is randn = np.random.randn, which is a very bad idea that is only useful to confuse users.

With a quick grep I could just find a single case where that is used:

whatsnew/v0.10.0.rst:  In [58]: p4d = Panel4D(randn(2, 2, 5, 4),

We should replace that case to use np.randon.randn explicitly, remove that line from the header in doc/source/conf.py and see in the doc builds if nothing fails after that change (this can be done locally or also in the CI).

@WuraolaOyewusi
Copy link
Contributor

WuraolaOyewusi commented Aug 21, 2019

Hi @marc.
Is this for testing?
I can infer that the issue is with using 'randn' as variable name not change np.random.randn to np.randon.randn.
Please clarify, I will send PR for this

@datapythonista
Copy link
Member Author

that's code that shows in the docs, I don't think in that specific case the code is even run by Sphinx, since that Panel4D class doesn't exist anymore.

The issue is that randn = np.random.randn is a very bad idea, and we'll make that code public now (we run it in the docs, but we don't show it now).

@WuraolaOyewusi
Copy link
Contributor

Ok, I will send a PR and tag you.

@datapythonista
Copy link
Member Author

@WuraolaOyewusi I think this was merged, feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants