Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
max_salary): return (val - min_salary) / (max_salary - min_salary) foo_vectorized = np.vectorize(foo) %timeit df["Normalized_Salary"] = foo_vectorized(df["Salary"], min_salary, max_salary) #154 ms ± 310 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) #conditional %timeit df["Old"] =