I understand this can easily be done manually using Calculate Field, however I'm looking to automate this process using ModelBuilder as it is a requirement of the current module.
I have 7 Weather columns in my soils feature class table, X Dry, Dry, Moist, Wet, X Wet, Frozen & X Frozen. The values of these fields are either GO, Restricted, Severely Restricted or Unknown. However they have purposely been assigned different values, so when being converted from a polygon to a raster Go should = 0, R = 1, SR + Unk = 2, but they don't all read like that when making it a Raster, giving me false outputs on my CCM analysis. I need to pre-engineer the soils data before bringing it into a raster calculator.
I have run a Calculate Field using Python:
Reclass(!WET_GO!)
def Reclass(field):
if field =='GO':
return 0
elif field == 'R':
return 1
elif field == 'SR':
return 2
elif field == 'UNK':
return 2
This gives me my desired output (see attached image) however it will only run for the one Field. I have tried using ArcGIS Pro's Iterate functions but I cant seem to figure out how to get it to run for all 7 of the weather conditions without adding 7 field calculators to my model which I do not want to do.
Currently it is just replacing the values in the attribute table but if it is easier new fields can be added to populate the 0/1/2 values in.