Skip to content

DOC: Add documentation for groupby.ewm() #61268

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
arthurlw opened this issue Apr 11, 2025 · 1 comment · Fixed by #61283
Closed
1 task done

DOC: Add documentation for groupby.ewm() #61268

arthurlw opened this issue Apr 11, 2025 · 1 comment · Fixed by #61283
Assignees
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@arthurlw
Copy link
Contributor

arthurlw commented Apr 11, 2025

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/dev/reference/groupby.html

Documentation problem

There is no reference for DataFrameGroupBy.ewm(), even though it exists in API, and Docstring can be greatly improved.

Similar to: #61254

E.g. consider working example:

>>> import pandas as pd
>>> pd.__version__
'2.2.3'
>>> data = {"Class": ["A", "A", "A", "B", "B", "B"],"Value": [10, 20, 30, 40, 50, 60],}
>>> df = pd.DataFrame(data)
>>> df
  Class  Value
0     A     10
1     A     20
2     A     30
3     B     40
4     B     50
5     B     60
>>> ewm_mean = (df.groupby("Class").ewm(span=2).mean().reset_index(drop=True))
>>> ewm_mean
   Value
0  10.000000
1  17.500000
2  26.153846
3  40.000000
4  47.500000
5  56.153846

Suggested fix for documentation

Include reference of DataFrameGroupBy.ewm and SeriesGroupBy.ewm, like for DataFrameGroupBy.rolling
and SeriesGroupBy.rolling

Improve groupby.ewm() function Docstring

@arthurlw arthurlw added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 11, 2025
@arthurlw
Copy link
Contributor Author

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant