pandas-dev/pandas · error · NotImplementedError

the 'numba' engine doesn't support lists of callables yet

Error message

the 'numba' engine doesn't support lists of callables yet

What it means

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.

Solutions

  1. Remove `engine='numba'` for list-like funcs.
  2. 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)`.
  3. Confirm numba is actually installed before relying on it.

Example fix

// before
df.apply([f1, f2], engine='numba')
// after
pd.concat([df.apply(f, engine='numba') for f in [f1, f2]], axis=1)
Defensive patterns

Strategy: validation

Validate before calling

def frame_apply_engine(df, func, engine='python'):
    import collections.abc as cabc
    multi = isinstance(func, (list, tuple)) or isinstance(func, cabc.Mapping)
    if engine == 'numba' and multi:
        import pandas as pd
        return pd.concat([df.apply(f, engine='numba') for f in func], axis=1)
    return df.apply(func, engine=engine)

Type guard

def numba_engine_supports(func) -> bool:
    import collections.abc as cabc
    return callable(func) and not isinstance(func, (list, tuple, dict, cabc.Mapping))

Try / catch

try:
    out = df.apply(funcs, engine='numba')
except NotImplementedError as e:
    if 'numba' in str(e).lower() and 'lists' in str(e).lower():
        import pandas as pd
        out = pd.concat([df.apply(f, engine='numba') for f in funcs], axis=1)
    else:
        raise

Prevention

When it happens

Trigger: `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.

Common situations: Reuse of `engine='numba'` (set for a single-callable apply) on a subsequent multi-function apply; copy-paste from a tutorial that used numba.

Related errors


AI-assisted analysis of pandas-dev/pandas@3b7651241d (2026-08-11). Data as JSON: /api/errors/048aee309434cd6c. Report an issue: GitHub.

Appendix: source

Thrown at pandas/core/apply.py:1015

    @property
    def res_columns(self) -> Index:
        return self.result_columns

    @property
    def columns(self) -> Index:
        return self.obj.columns

    @cache_readonly
    def values(self):
        return self.obj.values

    def apply(self) -> DataFrame | Series:
        """compute the results"""

        # dispatch to handle list-like or dict-like
        if is_list_like(self.func):
            if self.engine == "numba":
                raise NotImplementedError(
                    "the 'numba' engine doesn't support lists of callables yet"
                )
            return self.apply_list_or_dict_like()

        # all empty
        if len(self.columns) == 0 and len(self.index) == 0:
            return self.apply_empty_result()

        # string dispatch
        if isinstance(self.func, str):
            if self.engine == "numba":
                raise NotImplementedError(
                    "the 'numba' engine doesn't support using "
                    "a string as the callable function"
                )
            return self.apply_str()

        # ufunc

View on GitHub (pinned to 3b7651241d)