df = pd.DataFrame({'col1': ['w', 10, 20], 'col2': ['a', 30, np.nan]}, index
    =[1, 2, 0])
di = {(0): 'A', (2): 'B'}
df['col1'].put(list(di.keys()), list(di.values()))
print(df)
Remap values in pandas column with a dict