Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
runs, 1 loop each) #swifter.apply %timeit df["Normalized_Salary"] = df["Salary"].swifter.apply(lambda x: (x - min_salary) / (max_salary - min_salary)) #83.5 ms ± 478 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) Conclusion If vectorization is possible, it should be used for DataFrame