{"record":{"id":"b81de3ef72dc0f9a","repo":"pandas-dev/pandas","slug":"interpolate-is-not-implemented-for-dtype-self-dty-b81de3","errorCode":null,"errorMessage":"interpolate is not implemented for dtype={self.dtype}","messagePattern":"interpolate is not implemented for dtype=(.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/masked.py","lineNumber":2125,"sourceCode":"        **kwargs,\n    ) -> FloatingArray:\n        \"\"\"\n        See NDFrame.interpolate.__doc__.\n        \"\"\"\n        # NB: we return type(self) even if copy=False\n        if self.dtype.kind == \"f\":\n            if copy:\n                data = self._data.copy()\n                mask = self._mask.copy()\n            else:\n                data = self._data\n                mask = self._mask\n        elif self.dtype.kind in \"iu\":\n            copy = True\n            data = self._data.astype(\"f8\")\n            mask = self._mask.copy()\n        else:\n            raise NotImplementedError(\n                f\"interpolate is not implemented for dtype={self.dtype}\"\n            )\n\n        missing.interpolate_2d_inplace(\n            data,\n            method=method,\n            axis=0,\n            index=index,\n            limit=limit,\n            limit_direction=limit_direction,\n            limit_area=limit_area,\n            mask=mask,\n            **kwargs,\n        )\n        if not copy:\n            return self  # type: ignore[return-value]\n        if self.dtype.kind == \"f\":\n            return type(self)._simple_new(data, mask)  # type: ignore[return-value]","sourceCodeStart":2107,"sourceCodeEnd":2143,"githubUrl":"https://github.com/pandas-dev/pandas/blob/3b7651241d4da534b3559b60ef128e1c34f54116/pandas/core/arrays/masked.py#L2107-L2143","documentation":"Raised by BaseMaskedArray._interpolate when the dtype kind is neither 'f' (float) nor 'iu' (integer). Interpolation is only implemented for numeric masked arrays; boolean and other kinds cannot be interpolated and raise NotImplementedError.","triggerScenarios":"Calling interpolate (e.g. Series.interpolate backed by a masked array) on a nullable 'boolean' ExtensionArray, or any masked array whose dtype.kind is not in 'fiu'.","commonSituations":"Applying interpolate() to a boolean column with NAs expecting it to fill forward; running a generic NA-handling pipeline that calls interpolate on every column regardless of dtype.","solutions":["Use a fill method valid for the dtype: ffill(), bfill(), or fillna(mode).","Cast the column to a numeric dtype before interpolation if the data supports it.","Skip non-numeric columns when applying interpolate in a column-wise loop."],"exampleFix":"// before\nbool_arr.interpolate()   # raises\n// after\nbool_arr.ffill()         # valid fill for boolean","handlingStrategy":"validation","validationCode":"if arr.dtype.kind not in 'fiu':\n    result = arr.ffill()\nelse:\n    result = arr.interpolate()","typeGuard":"def is_interpolatable(arr) -> bool:\n    return arr.dtype.kind in 'fiu'","tryCatchPattern":"try:\n    result = arr.interpolate()\nexcept NotImplementedError as e:\n    if 'interpolate is not implemented' in str(e):\n        result = arr.ffill()\n    else:\n        raise","preventionTips":["Gate interpolate() calls on dtype.kind in 'fiu'.","Use ffill/bfill for non-numeric nullable columns.","Build dtype-aware NA-handling pipelines."],"tags":["pandas","masked-array","interpolate","dtype","boolean"],"backgroundTag":null,"analyzedSha":"3b7651241d4da534b3559b60ef128e1c34f54116","analyzedAt":"2026-08-11T22:10:44.015Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}