Skip to content

BUG: TimedeltaIndex slicing may reset freq #10292

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 7, 2015

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Jun 5, 2015

DatetimeIndex preserve freq after slicing.

di = pd.date_range('2001', '2005', freq='D')
di[1:5:2]
# DatetimeIndex(['2001-01-02', '2001-01-04'], dtype='datetime64[ns]', freq='2D', tz=None)

But TimedeltaIndex doesn't.

tdi = pd.timedelta_range('1day', '5day', freq='D')
tdi[1:5:2]
# TimedeltaIndex(['2 days', '4 days'], dtype='timedelta64[ns]', freq=None)

@sinhrks sinhrks added Bug Timedelta Timedelta data type Frequency DateOffsets labels Jun 6, 2015
@sinhrks sinhrks added this to the 0.16.2 milestone Jun 6, 2015
jreback added a commit that referenced this pull request Jun 7, 2015
BUG: TimedeltaIndex slicing may reset freq
@jreback jreback merged commit c5d15a0 into pandas-dev:master Jun 7, 2015
@jreback
Copy link
Contributor

jreback commented Jun 7, 2015

thanks you sir!

@sinhrks sinhrks deleted the tdi_freq branch June 8, 2015 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants