Suppose I have a DataFrame with some NaNs:
NaN
>>> import pandas as pd >>> df = pd.DataFrame([[1, 2, 3], [4, None, None], [None, N
ffill now has it's own method pd.DataFrame.ffill
ffill
df.ffill() 0 1 2 0 1.0 2.0 3.0 1 4.0 2.0 3.0 2 4.0 2.0 9.0