Skip to content

Conversation

@sinhrks
Copy link
Member

@sinhrks sinhrks commented Sep 8, 2015

Follow up of #10638. DatetimeIndex.freq also can be changed when other arg is an ndarray.

As the same as #10638, freq is re-infered only when it exists. Otherwise, leave it as None even if the result can be on specific freq. This is based on other functions behavior as below:

idx = pd.DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03'])
idx
# DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03'], dtype='datetime64[ns]', freq=None)
idx.take([0, 2])
# DatetimeIndex(['2011-01-01', '2011-01-03'], dtype='datetime64[ns]', freq=None)

idx = pd.DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03'], freq='D')
idx.take([0, 2])
# DatetimeIndex(['2011-01-01', '2011-01-03'], dtype='datetime64[ns]', freq='2D')

@sinhrks sinhrks added Bug Frequency DateOffsets labels Sep 8, 2015
@sinhrks sinhrks added this to the 0.17.0 milestone Sep 8, 2015
@jreback
Copy link
Contributor

jreback commented Sep 8, 2015

lgtm. merge on green.

sinhrks added a commit that referenced this pull request Sep 9, 2015
BUG: DatetimeIndex.freq can defer by ufunc
@sinhrks sinhrks merged commit 5567bf0 into pandas-dev:master Sep 9, 2015
@sinhrks sinhrks deleted the ufunc_freq branch September 9, 2015 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Frequency DateOffsets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants