Skip to content

REF: avoid using DTA/PA methods in Week.apply_index #34782

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 1 commit into from
Jun 15, 2020

Conversation

jbrockmendel
Copy link
Member

We avoid a couple of array allocations in the process.

In [2]: dti = pd.date_range("2016-01-01", periods=10000, freq="S")              
In [3]: off = pd.offsets.Week(1, False, 3)                                      
In [4]: %timeit dti + off                                                       
3.22 ms ± 30.7 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # <-- master
344 µs ± 4.97 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)  # <-- PR

@jreback jreback added the Frequency DateOffsets label Jun 15, 2020
@jreback jreback added this to the 1.1 milestone Jun 15, 2020
@jreback
Copy link
Contributor

jreback commented Jun 15, 2020

sure

@jreback jreback merged commit 18ab444 into pandas-dev:master Jun 15, 2020
@jbrockmendel jbrockmendel deleted the ref-liboffsets-to_period branch June 15, 2020 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants