5 faster alternatives to Pandas DataFrame apply()

 5 faster alternatives to Pandas DataFrame apply()

Want to apply a function to all rows in a Pandas Dataframe?

Use these instead:

🔹 Pandas itertuples()

🔹 List Comprehension

🔹 Python map()

🔹 NumPy vectorize()

🔹 Pandas Vectorization


If you are not averse to including extra libraries on multi-core:

🔹 Pandarallel

🔹 Dask

🔹 Swifter

🔹 Numba



Python pandas cheat sheets

Comments