Skip to content

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