pandas replace multiple values one column
Your replace format is off In [21]: df = pd.DataFrame({‘a’:[‘Small’, ‘Medium’, ‘High’]}) In [22]: df Out[22]: a 0 Small 1 Medium 2 High [3 rows x 1 columns] In [23]: df.replace({‘a’ : { ‘Medium’ : 2, ‘Small’ : 1, ‘High’ : 3 }}) Out[23]: a 0 1 1 2 2 3 [3 rows x 1 … Read more