{"record":{"id":"191ceb5e0d2b7bd6","repo":"pandas-dev/pandas","slug":"the-numba-engine-doesn-t-support-list-like-dict","errorCode":null,"errorMessage":"The 'numba' engine doesn't support list-like/dict likes of callables yet.","messagePattern":"The 'numba' engine doesn't support list-like/dict likes of callables yet\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"pandas/core/apply.py","lineNumber":755,"sourceCode":"                raise ValueError(f\"Operation {func} does not support axis=1\")\n            if \"axis\" in arg_names and not isinstance(\n                obj, (SeriesGroupBy, DataFrameGroupBy)\n            ):\n                self.kwargs[\"axis\"] = self.axis\n        return self._apply_str(obj, func, *self.args, **self.kwargs)\n\n    def apply_list_or_dict_like(self) -> DataFrame | Series:\n        \"\"\"\n        Compute apply in case of a list-like or dict-like.\n\n        Returns\n        -------\n        result: Series, DataFrame, or None\n            Result when self.func is a list-like or dict-like, None otherwise.\n        \"\"\"\n\n        if self.engine == \"numba\":\n            raise NotImplementedError(\n                \"The 'numba' engine doesn't support list-like/\"\n                \"dict likes of callables yet.\"\n            )\n\n        if self.axis == 1 and isinstance(self.obj, ABCDataFrame):\n            return self.obj.T.apply(self.func, 0, args=self.args, **self.kwargs).T\n\n        func = self.func\n        kwargs = self.kwargs\n\n        if is_dict_like(func):\n            result = self.agg_or_apply_dict_like(op_name=\"apply\")\n        else:\n            result = self.agg_or_apply_list_like(op_name=\"apply\")\n\n        result = reconstruct_and_relabel_result(result, func, **kwargs)\n\n        return result","sourceCodeStart":737,"sourceCodeEnd":773,"githubUrl":"https://github.com/pandas-dev/pandas/blob/3b7651241d4da534b3559b60ef128e1c34f54116/pandas/core/apply.py#L737-L773","documentation":"Raised at the top of `apply_list_or_dict_like` when `engine='numba'` is combined with a list-like or dict-like `func`. The numba engine in DataFrame.apply only supports a single callable operating on each column's values; vectorizing a sequence/dict of callables is not implemented, so pandas fails fast with NotImplementedError rather than silently falling back to the python engine.","triggerScenarios":"`df.apply([f1, f2], engine='numba')`, `df.apply({'A': f1}, engine='numba')`, `df.agg([...], engine='numba')`. Any path that reaches apply_list_or_dict_like with self.engine == 'numba'.","commonSituations":"Users enable numba for speed on a pipeline that uses list/dict agg specs; copy-pasting `engine='numba'` from a working single-callable call into a multi-function call.","solutions":["Drop `engine='numba'` and use the default python engine for list/dict funcs.","Apply each callable separately with `engine='numba'` and assemble the results manually: `pd.concat([df.apply(f, engine='numba') for f in [f1, f2]], axis=1)`.","Verify numba is installed (the python engine fallback path is not taken implicitly here)."],"exampleFix":"// before\ndf.apply([f1, f2], engine='numba')\n// after\ndf.apply([f1, f2])  # python engine","handlingStrategy":"validation","validationCode":"def apply_with_engine(df, func, engine='python'):\n    import collections.abc as cabc\n    is_multi = isinstance(func, (list, tuple, dict)) or cabc.Mapping\n    if engine == 'numba' and is_multi:\n        # fall back to python engine or apply each callable separately\n        return df.apply(func)  # python engine\n    return df.apply(func, engine=engine)","typeGuard":"def numba_supports_func(func) -> bool:\n    import collections.abc as cabc\n    return callable(func) and not isinstance(func, (list, tuple, dict)) and not isinstance(func, cabc.Mapping)","tryCatchPattern":"try:\n    out = df.apply(func, engine='numba')\nexcept NotImplementedError as e:\n    if 'numba' in str(e).lower():\n        out = df.apply(func)  # python fallback\n    else:\n        raise","preventionTips":["Only enable engine='numba' for single-callable apply.","Gate numba behind a helper that detects list/dict funcs.","Verify numba is installed before passing engine='numba'."],"tags":["pandas","apply","numba","notimplementederror","engine"],"backgroundTag":null,"analyzedSha":"3b7651241d4da534b3559b60ef128e1c34f54116","analyzedAt":"2026-08-11T22:10:44.015Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}