When `apply` Gets 50x Faster: CPU-Bound Custom Functions

The dramatic 50x+ speedup from Cython for `DataFrame.apply` is primarily realized in CPU-bound custom functions that involve significant computation per row, which would otherwise run slowly due to Python's per-row overhead, especially when Cython processes the underlying NumPy arrays directly.

Sources

Open the full topic