Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
normalize_for_itertuples(df, min_salary, max_salary) #1.34 s ± 4.29 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) def normalize_map(df, min_salary, max_salary): df["Normalized_Salary"] = df["Salary"].map(lambda x: (x - min_salary) / (max_salary - min_salary)) return df %timeit