A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/4604 below:

reindex strange behaviour · Issue #4604 · pandas-dev/pandas · GitHub

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?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4