I have a Pandas column with string value entries, which I have ensured are strings via
df[col].astype(str)
And I have created a dictionary out of an enumeration of these string values that takes the form
{...'hello': 56, 'yello': 71,...}
I have tried multiple map/replace implementations, but I cannot get the string values to update with their dictionary integer.
df[col].replace(lambda s: inv_map.get(s) if s in inv_map else s)
Is the most recent one I have tried. I dont get any errors or warnings, it simply doesnt map the values.