Skip to content

PERF: EWMA with times #40072

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

Merged
merged 4 commits into from
Feb 26, 2021
Merged

PERF: EWMA with times #40072

merged 4 commits into from
Feb 26, 2021

Conversation

mroeschke
Copy link
Member

In [1]: idx=pd.date_range('20000101','20201231',periods=50000)
   ...:
   ...: df=pd.DataFrame(data=range(50000),index=idx)

In [2]: %timeit df.ewm(halflife=pd.Timedelta('100d'),times=df.index).mean()

1.2 ms ± 13.8 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) <-- PR

10.2 s ± 32.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) <-- master

@mroeschke mroeschke added Performance Memory or execution speed performance Window rolling, ewma, expanding labels Feb 26, 2021
@mroeschke mroeschke added this to the 1.3 milestone Feb 26, 2021
@jreback jreback merged commit 859a787 into pandas-dev:master Feb 26, 2021
@jreback
Copy link
Contributor

jreback commented Feb 26, 2021

very nice!

@mroeschke mroeschke deleted the perf/ewma_times branch February 26, 2021 17:04
@simonjayhawkins
Copy link
Member

opened #42333 to keep track of this regression.

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

Successfully merging this pull request may close these issues.

PERF: ewm passed with times is so slow compared to ewm pased with int
4 participants