Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG/ER: misleading results when filling with a reversed index #4484

Closed
jreback opened this issue Aug 6, 2013 · 1 comment

Comments

@jreback
Copy link
Contributor

commented Aug 6, 2013

created by @prossahl

Reversing an index and forward filling succeeds but produces misleading data:

>>> dr = pd.date_range('2013-08-01', periods=6, freq='B')
>>> df = pd.DataFrame(np.random.randn(6,1), index=dr, columns=list('A'))
>>> df['A'][3] = np.nan
>>> df.reindex(df.index[::-1], method='ffill')
                   A
2013-08-08  2.127302
2013-08-07       NaN
2013-08-06       NaN
2013-08-05       NaN
2013-08-02       NaN
2013-08-01       NaN

This change enforces "monotocity" (well actually weakly increasing) and causes a ValueError to be raised.

@jtratner

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2013

Closed by #4642

@jtratner jtratner closed this Sep 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.