In [1]:
import pandas as pd
df = pd.DataFrame([['AA', 1], ['BB', 2], ['CC', 3]], columns=['name', 'value'])
In [2]:
df
Out[2]:
In [3]:
def function_1(val_1):
return "prefix_" + str(val_1)
In [4]:
df['name'] = df['name'].map(function_1)
In [5]:
df
Out[5]:
In [ ]: