{"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/71959b8cb9b2459c16e14b34f28b178ccfe14735/pandas/core/apply.py#L997-L1033","documentation":"Raised in `FrameApply.apply` when `func` is list-like AND `engine='numba'`. Even though each individual list entry might be a valid callable, the numba engine does not implement multi-callable dispatch — only a single callable is supported. Distinct from error 69 (which fires in `apply_list_or_dict_like`); this check guards the early dispatch in `FrameApply.apply`.","triggerScenarios":"`df.apply([f1, f2], engine='numba')` — list of callables. The check at apply.py:1014 fires before any dispatch.","commonSituations":"Passing a list of callables expecting numba to JIT each; copy-paste of engine='numba' from a single-callable call into a list call; refactoring that wraps a single callable into a list.","solutions":["Use the default python engine for list-of-callables: `df.apply([f1, f2])`.","Invoke numba per callable separately: `[df.apply(f, engine='numba', raw=True) for f in [f1, f2]]`.","Combine the callables into a single function returning a tuple/array if you need one numba pass."],"exampleFix":"# before\ndf.apply([f1, f2], engine='numba')\n# after\n[df.apply(f, engine='numba', raw=True) for f in [f1, f2]]","handlingStrategy":"validation","validationCode":"def safe_apply_numba(df, func, engine='python', **kw):\n    import collections.abc\n    if engine == 'numba' and isinstance(func, (list, tuple)):\n        raise ValueError('numba engine does not support list of callables')\n    return df.apply(func, engine=engine, **kw)","typeGuard":"def is_numba_compatible(func, engine) -> bool:\n    import collections.abc\n    return engine != 'numba' or (callable(func) and not isinstance(func, (list, tuple, str)))","tryCatchPattern":"try:\n    df.apply(funcs, engine='numba')\nexcept NotImplementedError as e:\n    if 'lists of callables' in str(e):\n        [df.apply(f, engine='numba', raw=True) for f in funcs]\n    else:\n        raise","preventionTips":["Pass a single callable to the numba engine; loop externally for multiple callables.","Centralize a helper that flags list-of-callables + numba."],"tags":["pandas","apply","numba","notimplementederror","list-of-callables"],"analyzedSha":"71959b8cb9b2459c16e14b34f28b178ccfe14735","analyzedAt":"2026-08-07T01:30:20.476Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}