Skip to content

API: DatetimeIndex.strftime should return an Index #20127

Closed
@jreback

Description

@jreback

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions