In pandas 1.2.0,
s = pd.Series([\'a\',\'b\']) s.replace(0, 1)
does not change s from \'a\',\'b\' to 1,\'b\'
s
\'a\',\'b\'
1,\'b\'