Have you upgraded to Pandas 3, rerun a notebook that worked last month, and been greeted by this?
prices = pd.Series([101.2, None, None, 104.8, None],
index=pd.date_range('2026-01-05', periods=5),
name='close')
prices.fillna(method='ffill')
TypeError: NDFrame.fillna() got an unexpected keyword argument 'method'
The short answer is that fillna(method='ffill') is now spelled ffill(), and fillna(method='bfill') is now spelled bfill():
prices.ffill()
2026-01-05 101.2
2026-01-06 101.2
2026-01-07 101.2
2026-01-08 104.8
2026-01-09 104.8
Freq: D, Name: close, dtype: float64
The same goes for the older aliases. method='pad' becomes ffill(), and method='backfill' becomes bfill(). The fix is identical on a data frame.
Why the argument went away
fillna used to do two different jobs. Given a value, it replaced each missing entry with that value. Given a method, it ignored values entirely and copied a neighbor into the gap. Those are different operations with different arguments, and one method signature was trying to describe both.
Pandas deprecated method= in version 2.1, when every call that used it started printing a FutureWarning telling you to use obj.ffill() or obj.bfill(). Version 3.0 removed it. So if the TypeError is the first you've heard of this, you may have jumped straight from an older version, or had warnings silenced somewhere.
What is left is cleaner. fillna fills with a value you choose, and ffill and bfill fill from neighbors.
If you came here from a stock-price notebook
Many people searching for this error mention yfinance, so it is worth saying plainly: I checked several yfinance releases, and the library does not call fillna(method=...) itself. The call is almost always in the notebook, often copied from an older tutorial, back when forward-filling closing prices over weekends and holidays was taught exactly this way. Updating yfinance will not help. Changing that one line will.
groupby lost fillna entirely
If your code filled within groups, you will see a different error:
df = pd.DataFrame({'ticker': ['AAPL', 'AAPL', 'MSFT', 'MSFT'],
'close': [230.1, None, None, 415.0]})
df.groupby('ticker').fillna(method='ffill')
AttributeError: 'DataFrameGroupBy' object has no attribute 'fillna'
Here the method is gone altogether, not just the argument. Call ffill on the group instead:
df.groupby('ticker')['close'].ffill()
0 230.1
1 230.1
2 NaN
3 415.0
Name: close, dtype: float64
Look at row 2. MSFT's first price is missing, and nothing earlier in the MSFT group can fill it, so it stays NaN. Compare that with a plain df['close'].ffill(), which would happily copy Apple's 230.1 into Microsoft's row. When your data contains several series stacked on top of each other, filling without grouping is not a small inaccuracy. It is a wrong number that looks right.
limit still works, and there is something better
The limit argument came along to ffill, so you can still refuse to paper over long gaps:
prices.ffill(limit=1)
2026-01-05 101.2
2026-01-06 101.2
2026-01-07 NaN
2026-01-08 104.8
2026-01-09 104.8
Freq: D, Name: close, dtype: float64
Newer, and often more useful, is limit_area='inside', which fills only gaps that have real values on both sides:
prices.ffill(limit_area='inside')
2026-01-05 101.2
2026-01-06 101.2
2026-01-07 101.2
2026-01-08 104.8
2026-01-09 NaN
Freq: D, Name: close, dtype: float64
The last day stays empty. Carrying a price forward between two known prices is a reasonable guess. Carrying it past the end of your data is inventing a closing price for a day you know nothing about.
method= is not gone everywhere
This trips people up after the fact. method= was removed from fillna, not from Pandas. reindex(method='ffill') still works, and so does resample(...).ffill(). If a search-and-replace across your code base turned every method='ffill' into something else, check those calls too.
Practice
Forward-filling is one of the first things you reach for with time series, and one of the easiest to get subtly wrong. See fillna in Pandas and ffill in Pandas for worked examples on real data, and try the fillna exercise to check your understanding.