Skip to content

REF: share PeriodArray.asfreq with Period.asfreq #39277

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 2 commits into from
Jan 20, 2021

Conversation

jbrockmendel
Copy link
Member

Slightly faster for PeriodArray, no change for Period.

In [3]: pi = pd.period_range("2016-01-01", periods=100, freq="D")

In [4]: %timeit pi.asfreq("W")
43.5 µs ± 696 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <-- master
36.3 µs ± 1.06 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <-- PR

In [5]: per = pi[0]

In [6]: %timeit per.asfreq("W")
10.5 µs ± 88.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  #  <-- master
10.5 µs ± 160 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  # <-- PR

@jreback jreback added the Period Period data type label Jan 19, 2021
@jreback jreback added this to the 1.3 milestone Jan 19, 2021
@jreback jreback merged commit d40d0c5 into pandas-dev:master Jan 20, 2021
@jbrockmendel jbrockmendel deleted the ref-period_asfreq-share branch January 20, 2021 19:24
nofarm3 pushed a commit to nofarm3/pandas that referenced this pull request Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Period Period data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants