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

ENH: Add online operations for EWM.mean #41888

Merged
merged 30 commits into from
Jun 12, 2021

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added this to the 1.3 milestone Jun 9, 2021
@mroeschke mroeschke added Enhancement Window rolling, ewma, expanding labels Jun 9, 2021
Copy link
Contributor

@jreback jreback left a 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

Copy link
Member Author

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.

Copy link
Contributor

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)

Copy link
Member Author

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,
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doctest failing

@simonjayhawkins simonjayhawkins mentioned this pull request Jun 10, 2021
@simonjayhawkins
Copy link
Member

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

@jreback
Copy link
Contributor

jreback commented Jun 11, 2021

this is not a blocker for the rc (though would like to get it in)

@simonjayhawkins
Copy link
Member

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.

@jreback
Copy link
Contributor

jreback commented Jun 11, 2021

likley to merge if ci checks run ok this time

@jreback
Copy link
Contributor

jreback commented Jun 11, 2021

this lgtm.

any comments @pandas-dev/pandas-core

@simonjayhawkins simonjayhawkins merged commit 8f70ed5 into pandas-dev:master Jun 12, 2021
@simonjayhawkins
Copy link
Member

Thanks @mroeschke

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

Successfully merging this pull request may close these issues.

4 participants