What If .apply() Is Too Slow?

Sometimes we need to apply some function to the Pandas Dataframe in Python by using its column(s) as the function's input. However, one of the most used methods .apply() to the entire data frame can take you longer than expected. What should we do?

Yufeng
Towards Data Science
6 min readDec 8, 2022

--

Photo by Chris Liverani on Unsplash

--

--

Ph.D., Data Scientist and Bioinformatician. Support my writing by becoming one of my referred members: https://jianan-lin.medium.com/membership