{"record":{"id":"bf43a601da7c8462","repo":"pandas-dev/pandas","slug":"type-self-name-does-not-implement-interpola","errorCode":null,"errorMessage":"{type(self).__name__} does not implement interpolate","messagePattern":"(.+?) does not implement interpolate","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/base.py","lineNumber":1298,"sourceCode":"\n        Interpolating values in a FloatingArray:\n\n        >>> arr = pd.array([1.0, pd.NA, 3.0, 4.0, pd.NA, 6.0], dtype=\"Float64\")\n        >>> arr.interpolate(\n        ...     method=\"linear\",\n        ...     axis=0,\n        ...     index=pd.Index(range(len(arr))),\n        ...     limit=None,\n        ...     limit_direction=\"both\",\n        ...     limit_area=None,\n        ...     copy=True,\n        ... )\n        <FloatingArray>\n        [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]\n        Length: 6, dtype: Float64\n        \"\"\"\n        # NB: we return type(self) even if copy=False\n        raise NotImplementedError(\n            f\"{type(self).__name__} does not implement interpolate\"\n        )\n\n    def _pad_or_backfill(\n        self,\n        *,\n        method: FillnaOptions,\n        limit: int | None = None,\n        limit_area: Literal[\"inside\", \"outside\"] | None = None,\n        copy: bool = True,\n    ) -> Self:\n        \"\"\"\n        Pad or backfill values, used by Series/DataFrame ffill and bfill.\n\n        This method propagates the last valid observation forward (pad/ffill)\n        or the next valid observation backward (backfill/bfill) to fill NaN\n        values.\n","sourceCodeStart":1280,"sourceCodeEnd":1316,"githubUrl":"https://github.com/pandas-dev/pandas/blob/71959b8cb9b2459c16e14b34f28b178ccfe14735/pandas/core/arrays/base.py#L1280-L1316","documentation":"Default ExtensionArray.interpolate (base.py:1298) raises NotImplementedError because interpolation is dtype-specific and the base class cannot provide a correct generic implementation. Subclasses like FloatingArray and NumpyExtensionArray override it; any ExtensionArray subclass that does not will hit this stub. The message names the offending class so the user knows which type lacks support.","triggerScenarios":"Calling .interpolate() (or DataFrame.interpolate) on a column backed by an ExtensionArray subclass that does not override interpolate (e.g. a custom EA, or some non-numeric EAs). Also reached via Series.interpolate(method=...) dispatch.","commonSituations":"Authoring a third-party ExtensionArray and forgetting to implement interpolate; calling interpolate on a categorical/string-dtype column expecting fill behavior; version upgrade where interpolation dispatch changed.","solutions":["Override interpolate() in your ExtensionArray subclass, returning type(self).","Convert the column to a supported dtype before interpolating, e.g. s.astype('Float64').interpolate(...).","Use fillna/ffill/bfill instead of interpolate for non-numeric dtypes.","If working with a custom EA from a library, upgrade that library or open an issue requesting interpolate support."],"exampleFix":"# before\nclass MyEA(ExtensionArray): ...\ns_my.interpolate(method=\"linear\", ...)  # raises\n\n# after (subclass)\ndef interpolate(self, *, method, axis, index, limit, limit_direction, limit_area, copy, **kwargs):\n    return self  # or real impl","handlingStrategy":"type-guard","validationCode":"def supports_interpolate(s):\n    import pandas as pd\n    return s.dtype.kind in \"iufcb\" or pd.api.types.is_float_dtype(s)","typeGuard":"def is_interpolatable_dtype(dtype) -> bool:\n    import pandas as pd as _\n    return dtype.kind in (\"i\", \"u\", \"f\", \"c\", \"b\") or str(dtype) in (\"Float64\", \"Float32\", \"Int64\", \"Int32\")","tryCatchPattern":"try:\n    s.interpolate(method=\"linear\", axis=0, index=s.index, limit=None, limit_direction=\"forward\", limit_area=None, copy=True)\nexcept NotImplementedError as e:\n    if \"does not implement interpolate\" in str(e):\n        s = s.astype(\"Float64\").interpolate(method=\"linear\", axis=0, index=s.index, limit=None, limit_direction=\"forward\", limit_area=None, copy=True)\n    else:\n        raise","preventionTips":["Override interpolate() on custom ExtensionArray subclasses","Convert to Float64 before interpolating non-numeric data","Prefer ffill/bfill for non-numeric fill"],"tags":["extension-array","interpolate","not-implemented","subclass"],"analyzedSha":"71959b8cb9b2459c16e14b34f28b178ccfe14735","analyzedAt":"2026-08-07T01:30:20.476Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}