Skip to content

BUG: label-based slices don't support negative step #8716

Closed
@immerrr

Description

@immerrr

Something feels wrong about this:

In [35]: s = pd.Series(np.arange(6), index=list('abcdef'))

In [36]: s
Out[36]: 
a    0
b    1
c    2
d    3
e    4
f    5
dtype: int64

In [37]: s.loc['e'::-1]
Out[37]: Series([], dtype: int64)

In [38]: s.iloc[4::-1]
Out[38]: 
e    4
d    3
c    2
b    1
a    0
dtype: int64

In [39]: s['e'::-1]
Out[39]: Series([], dtype: int64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated 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