Skip to content

Calling shift on a DatetimeIndex of length 0 returns an Index instead of a DatetimeIndex  #9903

Closed
@ssanderson

Description

@ssanderson

Minimal repro:

In [5]: pandas.__version__
Out[5]: '0.16.0-151-gcef3c85'

In [7]: DatetimeIndex([]).shift(3, 'H')
Out[7]: Index([], dtype='object')

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions