Skip to content

BUG: reindex strange behaviour #4604

Closed
@alefnula

Description

@alefnula

When I try to reindex a Series object I get a really weird result.

>>> s = pd.Series([1,2,3,4,5], index=['a', 'b', 'c', 'd', 'e'])
>>> s.reindex(['a', 'g', 'c', 'f'], method='ffill')
a     1
g     5
c   NaN
f     5
dtype: float64

According to the documentation I should have got something like:

a   1
g   1
c   3
f   3
dtype: float64

So either the documentation is not valid, or reindex is not working correctly or I haven't understood how this beast works?

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