Skip to content

BUG: DatetimeIndex.freq can defer by ufunc #11024

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

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