I want to replace values in a pandas Series
using a dictionary. I'm following @DSM's accepted answer like so:
s = Series(['abc', 'abe', 'abg'])
d = {'b': 'B'}
s.replace(d)
But this has no affect:
0 abc
1 abe
2 abg
dtype: object
The documentation explains the required format of the dict for DataFrames
(i.e. nested dicts with top level keys corresponding to column names) but I can't see anything specific for Series
.