Skip to content

API: DatetimeIndex.strftime should return an Index #20127

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

Closed
jreback opened this issue Mar 10, 2018 · 0 comments · Fixed by #20240
Closed

API: DatetimeIndex.strftime should return an Index #20127

jreback opened this issue Mar 10, 2018 · 0 comments · Fixed by #20240
Labels
API Design Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype good first issue
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Mar 10, 2018

Index.strftime should be returning an Index and not an array, we do this for other accessors. see https://github.com/pandas-dev/pandas/pull/20103/files#r173622263

In [6]: pd.date_range('20130101',periods=3).hour
Out[6]: Int64Index([0, 0, 0], dtype='int64')

In [7]: pd.date_range('20130101',periods=3).strftime('%Y%m%d')
Out[7]: array(['20130101', '20130102', '20130103'], dtype='<U8')
@jreback jreback added Datetime Datetime data dtype API Design Compat pandas objects compatability with Numpy or Python functions Effort Low good first issue labels Mar 10, 2018
@jreback jreback added this to the 0.23.0 milestone Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant