-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame.ffill behaves different than DataFrame.interpolate(method='ffill') along axes #12918
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
Comments
I suppose you mean the For other methods (eg the default 'linear'), the direction is as expected (axis=0 -> filling per column), but for
Also have to note that this behaviour is already there since the beginning (tested 0.13), but the ability to specify filling methods in @TomAugspurger Is there a reason for this behaviour, or is it just a bug? |
You are correct Joris, that's what I was referring to. [edit: remove email history] |
Yes! But will probably have to wait until this weekend. |
hmm, we should not be accepting the fill methods directly in |
@jreback It would be nice to see Alternatively, these kwarg could be added to . Which would be more desirable? Thanks. |
i think ok to accept them here but leaving the existing api as it’s pretty functional as it is) |
I guess I am still having the same bug with pandas version 0.24.2 import numpy as np
import pandas as pd
tdf = pd.DataFrame({'a': [0, 1, np.nan], 'b': [5, np.nan, np.nan]}) Returns a dataframe
tdf.fillna(method='pad')
While tdf.interpolate(method='pad') applies the padding per row:
|
It looks like
df.ffill(axis=0)
has the same behavior astest_df.interpolate(method='ffill', axis=1)
.Is this the desired behavior?
The text was updated successfully, but these errors were encountered: