I am using ArcGIS Desktop 10.6.

I have one field that is titled SEVERITY, and is string type, and has words like "Medium" "Low" "High," etc. I would like to assign a number to correspond with the word ("1" for "Low", 2 for "Medium," etc.), and to have that populate in a new field.

I've created the new field, called it "SEVERITY_CODE" and made it an integer. All I need to do is use the field calculator to say "look at the SEVERITY column, and translate that into numbers for the "SEVERITY_CODE" column but I cannot seem to find it. The solutions I've found on the web are not helping.

Can anyone help with this?


1 Answer 1


Something like (using python):

def calc(SEVERITY_CODE):
    if SEVERITY == "Low":
        return 1
    elif SEVERITY == "Medium":
        return 2
        return 3

Examples: Writing conditional (if/then) statements into Field Calculator of ArcGIS for Desktop using Python parser? and Use Python in ArcGIS Field Calculator to return value based on numeric value in any of three other fields

Not the answer you're looking for? Browse other questions tagged or ask your own question.