{"record":{"id":"048aee309434cd6c","repo":"pandas-dev/pandas","slug":"the-numba-engine-doesn-t-support-lists-of-callab","errorCode":null,"errorMessage":"the 'numba' engine doesn't support lists of callables yet","messagePattern":"the 'numba' engine doesn't support lists of callables yet","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"pandas/core/apply.py","lineNumber":1015,"sourceCode":"    @property\n    def res_columns(self) -> Index:\n        return self.result_columns\n\n    @property\n    def columns(self) -> Index:\n        return self.obj.columns\n\n    @cache_readonly\n    def values(self):\n        return self.obj.values\n\n    def apply(self) -> DataFrame | Series:\n        \"\"\"compute the results\"\"\"\n\n        # dispatch to handle list-like or dict-like\n        if is_list_like(self.func):\n            if self.engine == \"numba\":\n                raise NotImplementedError(\n                    \"the 'numba' engine doesn't support lists of callables yet\"\n                )\n            return self.apply_list_or_dict_like()\n\n        # all empty\n        if len(self.columns) == 0 and len(self.index) == 0:\n            return self.apply_empty_result()\n\n        # string dispatch\n        if isinstance(self.func, str):\n            if self.engine == \"numba\":\n                raise NotImplementedError(\n                    \"the 'numba' engine doesn't support using \"\n                    \"a string as the callable function\"\n                )\n            return self.apply_str()\n\n        # ufunc","sourceCodeStart":997,"sourceCodeEnd":1033,"githubUrl":"https://github.com/pandas-dev/pandas/blob/3b7651241d4da534b3559b60ef128e1c34f54116/pandas/core/apply.py#L997-L1033","documentation":"Raised at the top of `FrameApply.apply` when `self.func` is list-like and `engine='numba'`. Same policy as error 65 but in the FrameApply entry point: numba only supports a single callable, never a list of callables, so pandas fails fast with NotImplementedError instead of silently using the python engine.","triggerScenarios":"`df.apply([f1, f2], engine='numba')`, `df.agg([f1, f2], engine='numba')`, or any frame apply where `is_list_like(self.func)` is true and engine is numba.","commonSituations":"Reuse of `engine='numba'` (set for a single-callable apply) on a subsequent multi-function apply; copy-paste from a tutorial that used numba.","solutions":["Remove `engine='numba'` for list-like funcs.","Apply each callable with numba individually and concatenate: `pd.concat([df.apply(f, engine='numba').rename(f.__name__) for f in [f1, f2]], axis=1)`.","Confirm numba is actually installed before relying on it."],"exampleFix":"// before\ndf.apply([f1, f2], engine='numba')\n// after\npd.concat([df.apply(f, engine='numba') for f in [f1, f2]], axis=1)","handlingStrategy":"validation","validationCode":"def frame_apply_engine(df, func, engine='python'):\n    import collections.abc as cabc\n    multi = isinstance(func, (list, tuple)) or isinstance(func, cabc.Mapping)\n    if engine == 'numba' and multi:\n        import pandas as pd\n        return pd.concat([df.apply(f, engine='numba') for f in func], axis=1)\n    return df.apply(func, engine=engine)","typeGuard":"def numba_engine_supports(func) -> bool:\n    import collections.abc as cabc\n    return callable(func) and not isinstance(func, (list, tuple, dict, cabc.Mapping))","tryCatchPattern":"try:\n    out = df.apply(funcs, engine='numba')\nexcept NotImplementedError as e:\n    if 'numba' in str(e).lower() and 'lists' in str(e).lower():\n        import pandas as pd\n        out = pd.concat([df.apply(f, engine='numba') for f in funcs], axis=1)\n    else:\n        raise","preventionTips":["Reserve engine='numba' for single-callable frame apply.","Loop-and-concat when you need multiple numba-compiled funcs.","Gate engine choice in a helper that inspects func type."],"tags":["pandas","apply","numba","list-like","notimplementederror"],"backgroundTag":null,"analyzedSha":"3b7651241d4da534b3559b60ef128e1c34f54116","analyzedAt":"2026-08-11T22:10:44.015Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}