Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
ms per loop (mean ± std. dev. of 7 runs, 1 loop each) The map() method allows us to replace each value in a Series according to a given function or mapping. print(df["Salary_Category"].map({'High': "H", "Mid Level": "M", "Low": "L"})) """ 0 H 1 H 2 M 3 H 4 L .. 999995 H 999996 L 999997 H 999998 H