Skip to content

DOC: rolling return type inconsistent with doc #43023

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
debnathshoham opened this issue Aug 13, 2021 · 2 comments · Fixed by #43030
Closed

DOC: rolling return type inconsistent with doc #43023

debnathshoham opened this issue Aug 13, 2021 · 2 comments · Fixed by #43030
Labels
Closing Candidate May be closeable, needs more eyeballs Docs Window rolling, ewma, expanding

Comments

@debnathshoham
Copy link
Member

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.core.window.rolling.Rolling.min.html

Note: You can check the latest versions of the docs on master here.

Documentation problem

the return type of rolling methods (rolling.min / rolling.max) is mentioned to be same as the original object. But the default return types appears to be float64.

>>> import pandas as pd
>>> s = pd.Series([4, 3, 5, 2, 6])
>>> s.dtypes
dtype('int64')
>>> s.rolling(3).min().dtypes
dtype('float64')
>>> s.rolling(3).max().dtypes
dtype('float64')
>>> s.rolling(3).std().dtypes
dtype('float64')

Suggested fix for documentation

Maybe the doc should mention the default return type

@debnathshoham debnathshoham added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 13, 2021
@phofl
Copy link
Member

phofl commented Aug 13, 2021

@phofl phofl added Closing Candidate May be closeable, needs more eyeballs Window rolling, ewma, expanding and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 13, 2021
@mroeschke
Copy link
Member

The first mention of type relates to the type of object, but I guess could also add a note specifically about the dtype to avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closing Candidate May be closeable, needs more eyeballs Docs Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants