In [1]:
import pandas as pd
In [2]:
df = pd.DataFrame([['One', 'Two'], ['Four', 'Abcd'], ['One', 'Bcd'], ['Five', 'Cd']], columns=['A', 'B'])
In [3]:
df
Out[3]:
In [4]:
df.loc[df['A'] == 'One', 'A'] = 0
In [5]:
df
Out[5]:
In [ ]: