Skip to content

DOC: Series.rolling and DataFrame.rolling share docstring #45969

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

Closed
1 task done
MichaelTiemannOSC opened this issue Feb 13, 2022 · 4 comments · Fixed by #47109
Closed
1 task done

DOC: Series.rolling and DataFrame.rolling share docstring #45969

MichaelTiemannOSC opened this issue Feb 13, 2022 · 4 comments · Fixed by #47109
Labels
Docs Window rolling, ewma, expanding

Comments

@MichaelTiemannOSC
Copy link
Contributor

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.Series.rolling.html?highlight=series%20rolling#pandas.Series.rolling

Documentation problem

The documentation of the Series function contains references to axis, which makes no sense for a Series (which is one-dimensional). It also refers to single vs. table functionality, which again makes no sense for a Series (which is single-only).

I can see that in cases like drop and dropna, axis exists as a parameter, but clearly states that there is only one axis. In other documentation (such as groupby) the series documentation invites both row and column axis.

Suggested fix for documentation

The Series documentation for rolling should follow the pattern of explaining axis as provided by drop/dropna. All Series functions with an axis parameter should be checked and fixed if necessary.

@MichaelTiemannOSC MichaelTiemannOSC added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 13, 2022
@phofl
Copy link
Member

phofl commented Feb 14, 2022

Hi, thanks for your report. The drop and dropna functions have one implementation for Series and DataFrame each while for rolling aggregations there is only one implementation. Hence the identical dostring. Not sure if we can fix this easily.

@phofl phofl added Window rolling, ewma, expanding and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 14, 2022
@simonjayhawkins simonjayhawkins changed the title DOC: Series.rolling copy/paste error DOC: Series.rolling and DataFrame.rolling share docstring Feb 14, 2022
@jackgoldsmith4
Copy link
Contributor

#47109 adds docs for all Series functions that take an axis parameter to explain that the axis parameter is unused in Series and only for compatibility with DataFrame. That seems like it might close this issue as well?

@MichaelTiemannOSC
Copy link
Contributor Author

It does, thank you!

@jreback
Copy link
Contributor

jreback commented May 27, 2022

the PR has not been merged
instead you can add a refeneve there and will close the issue when it's merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants