pandas-dev/pandas · error · NotImplementedError
interpolate is not implemented for dtype={self.dtype}
Error message
interpolate is not implemented for dtype={self.dtype} What it means
Raised inside interpolate for numeric-but-not-int-or-float dtypes that don't fit the missing.interpolate_2d_inplace path. Temporal/decimal/etc. numeric-like arrow types that aren't 'f' or 'iu' kinds are not implemented for the general interpolation algorithms.
Source
Thrown at pandas/core/arrays/arrow/array.py:3173
method == "linear"
and limit_area is None
and limit is None
and limit_direction == "forward"
):
values = self._pa_array.combine_chunks()
na_value = pa.array([None], type=values.type)
y_diff_2 = pc.fill_null_backward(pc.pairwise_diff_checked(values, period=2))
prev_values = pa.concat_arrays([na_value, values[:-2], na_value])
interps = pc.add_checked(prev_values, pc.divide_checked(y_diff_2, 2))
return self._from_pyarrow_array(pc.coalesce(self._pa_array, interps))
mask = self.isna()
if self.dtype.kind == "f":
data = self._pa_array.to_numpy()
elif self.dtype.kind in "iu":
data = self.to_numpy(dtype="f8", na_value=0.0)
else:
raise NotImplementedError(
f"interpolate is not implemented for dtype={self.dtype}"
)
missing.interpolate_2d_inplace(
data,
method=method,
axis=0,
index=index,
limit=limit,
limit_direction=limit_direction,
limit_area=limit_area,
mask=mask,
**kwargs,
)
return self._from_pyarrow_array(self._box_pa_array(pa.array(data, mask=mask)))
@classmethod
def _if_else(View on GitHub (pinned to 71959b8cb9)
Solutions
- Use the supported fast path: `method='linear'`, `limit_direction='forward'`, with no `limit`/`limit_area`.
- Cast to a numeric dtype, interpolate, then cast back: `s.astype('int64[pyarrow]').interpolate(...)` for timestamps.
- Use `.ffill()`/`.bfill()` as a fallback for temporal columns.
Example fix
// before s = pd.Series(pd.to_datetime(["2020-01-01", None, "2020-01-03"]), dtype="timestamp[ns][pyarrow]") s.interpolate(method="index") // after s.interpolate(method="linear", limit_direction="forward")
Defensive patterns
Strategy: fallback
Validate before calling
def safe_interpolate(s, method="linear", **kw):
if getattr(s.dtype, "kind", None) not in {"f", "i", "u"}:
# only the fast linear path supports other numeric-like dtypes; otherwise cast
if method != "linear" or kw.get("limit_area") or kw.get("limit") or kw.get("limit_direction") != "forward":
s = s.astype("int64[pyarrow]") if s.dtype.kind in "mM" else s
return s.interpolate(method=method, **kw) Type guard
def interpolate_implemented(arr) -> bool:
kind = getattr(arr.dtype, "kind", None)
return kind in {"f", "i", "u"} Try / catch
try:
s.interpolate(method=method)
except NotImplementedError as e:
if "interpolate is not implemented for dtype" in str(e):
s.astype("int64[pyarrow]").interpolate(method=method)
else:
raise Prevention
- For temporal arrow dtypes prefer method='linear' with limit_direction='forward'.
- Cast to int64 ns representation for unsupported interpolation methods on timestamps.
- Keep an ffill/bfill fallback for non-float dtypes.
When it happens
Trigger: Calling `Series.interpolate()` on a pyarrow-backed temporal/decimal column with a method other than the supported fast linear path (e.g. `method='index'`, `'pad'`, or with `limit_area`/`limit` set on a timestamp dtype).
Common situations: Interpolating timestamp/date/decimal arrow columns with non-linear methods, or with limit/limit_area parameters that bypass the optimized linear branch.
Related errors
- {type(self)} does not support reshape as backed by a 1D pyar
- Cannot interpolate with {self.dtype} dtype
- {type(self).__name__} does not implement interpolate
- interpolate is not implemented for dtype={self.dtype}
- replace is not supported with a re.Pattern, callable repl, c
AI-assisted analysis of pandas-dev/pandas@71959b8cb9 (2026-08-07).
Data as JSON: /api/errors/d8f1b1bbb16aa82d.
Report an issue: GitHub.