I have a function called unit_unify() that I want to apply to every column of the dataframe. I have been trying to devise the pandas equivalent using apply/apply map, but have not been successul.
Here is the for loop
for i in df.columns:
df[i] = unit_unify(df[i], unit_dict)
Here is the attempt at the pandas equivalent of the for loop
df = df.apply(lambda col: unit_unify(df[col], unit_dict))