Skip to content

BUG: EWM.__getitem__ raised error with times #40164

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 8 commits into from
Mar 3, 2021

Conversation

mroeschke
Copy link
Member

  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

Also somewhat ameliorates the performance hit in #40072 (comment)

dtype="float"
window=1000
N = 10 ** 5
arr = (100 * np.random.random(N)).astype(dtype)
ewm = pd.Series(arr).ewm(halflife=window)

%timeit ewm.mean()
# Master
2.59 ms ± 25.5 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

# PR
2.5 ms ± 31.5 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

@mroeschke mroeschke added Bug Window rolling, ewma, expanding labels Mar 2, 2021
@mroeschke mroeschke added this to the 1.3 milestone Mar 2, 2021
@jreback
Copy link
Contributor

jreback commented Mar 2, 2021

does this address #40099?

@mroeschke
Copy link
Member Author

does this address #40099?

No, that issue has the expected output given the formula we're using but needs a discussion whether we want to make an exception in that case

@jreback jreback merged commit 579b75a into pandas-dev:master Mar 3, 2021
@jreback
Copy link
Contributor

jreback commented Mar 3, 2021

thanks @mroeschke

@mroeschke mroeschke deleted the perf/ewm branch March 3, 2021 20:23
@mroeschke mroeschke mentioned this pull request Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants