I have a data frame with an integer column representing severity values [1, 2, 3, 4]
. I wish to convert this to an enumerated column with descriptive labels [Critical, High, Medium, Low]
. Adding a new column as mentioned in this answer works, but I'd like to do this mapping in-place as I have a few more columns to be converted.
i.e. Convert this:
Severity
0 1
1 2
2 1
...
to this:
Severity
0 Critical
1 High
2 Critical
...
What is the best way to achieve this in Pandas?