Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
ENH/BUG: Period and PeriodIndex ops supports timedelta-like #7966
Conversation
jreback
added Bug Period Timedelta
labels
Aug 8, 2014
jreback
added this to the
0.15.0
milestone
Aug 8, 2014
jreback
commented on the diff
Aug 8, 2014
pandas/tseries/period.py
| @@ -862,6 +896,22 @@ def to_timestamp(self, freq=None, how='start'): | ||
| new_data = tslib.periodarr_to_dt64arr(new_data.values, base) | ||
| return DatetimeIndex(new_data, freq='infer', name=self.name) | ||
| + def _add_delta(self, other): | ||
| + if isinstance(other, (timedelta, np.timedelta64, offsets.Tick)): |
jreback
Contributor
|
jreback
and 1 other
commented on an outdated diff
Aug 8, 2014
jreback
added a commit
that referenced
this pull request
Aug 10, 2014
|
|
jreback |
e800fe1
|
jreback
merged commit e800fe1
into pandas-dev:master
Aug 10, 2014
1 check passed
continuous-integration/travis-ci
The Travis CI build passed
Details
|
thanks @sinhrks |
sinhrks
deleted the
sinhrks:period_delta branch
Aug 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sinhrks commentedAug 8, 2014
Must be revisited after #7954 to remove
_skip_if_not_numpy17_friendlyCloses #7740.
Allow
PeriodandPeriodIndexaddandsubto supporttimedelta-like. If period freq isoffsets.Tick, offsets can be added if the result can have same freq. Otherwise,ValueErrorwill be raised.If period freq isn't
Tick, only the same offset can be added. Otherwise,ValueErrorwill be raised.