-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
ENH: Add online operations for EWM.mean #41888
Conversation
mroeschke
commented
Jun 9, 2021
- xref ENH: Support online operations in windowing operations #41673
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
max(self._selected_obj.shape[self.axis - 1] - 1, 0), dtype=np.float64 | ||
) | ||
if update is not None: | ||
if self._mean.last_ewm is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user needs to call mean()
first then can call mean(update=new_df)
This checks that mean()
was called first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, and test for this? (with good error message)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -10892,7 +10892,7 @@ def ewm( | |||
span: float | None = None, | |||
halflife: float | TimedeltaConvertibleTypes | None = None, | |||
alpha: float | None = None, | |||
min_periods: int = 0, | |||
min_periods: int | None = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this (and the changed annotation below) orthogonal to the rest of the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit.
EWM.min_periods
was typed as int
It's parent class typed min_periods
as int | None
.
Since I was calling super
needed to get the types and some code aligned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doctest failing
After a discussion with @jorisvandenbossche have added a new tag so that the 1.3 milestone can be added to PRs that are for 1.3 but not needed for the rc. Have added a blocker tag here since I'm not sure whether this was to be included in the rc. feel free to remove |
this is not a blocker for the rc (though would like to get it in) |
OK barring anything else then, assume we are releasing tomorrow if this is not a blocker. If you really want to include it. add back the blocker tag and I won't release. |
likley to merge if ci checks run ok this time |
this lgtm. any comments @pandas-dev/pandas-core |
Thanks @mroeschke |