I am working with the field calculator in ArcPro. I have created a dictionary where the Key is an existing value in a field and the value is the one I would like to replace the existing value with. Below is a portion of my dictionary.
plant_dictionary = {
"ABUT THE": "Velvet leaf",
"ACRO REP": "Russian knapweed",
"AEGI CYL": "Jointed goatgrass",
"AEGO POD": "Goutweed / bishop's weed",
"AILA ALT": "Tree of heaven",
"ALHA MAU": "Camel thorn",
"ALLI PET": "Garlic mustard"
} then I have this bit of code where INV_SP_PLA is the field whose data I am trying to replace.
for r in plant_dictionary:
if !INV_SP_PLA! in r:
!INV_SP_PLA!.replace(r, plant_dictionary[r])
else:
passArcPro does not like my dictionary for some reason and I am unsure of what to put in the Expression portion of the field calculator.
Any ideas why this might not be working?