Python, Pandas, Data Science, Machine Learning, Pandas Dataframe.
dtype: object """ %timeit df["Salary_Category"] = df["Salary"].apply(foo) #112 ms ± 50.6 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) def boo(): liste = [] for i in range(len(df)): val = foo(df.loc[i,"Salary"]) liste.append(val) df["Salary_Category"] = liste %timeit boo() #5.73 s ± 130