Using BERA's suggestion this is the dictionary that was successful in creating the soil class values.
fc= r'D:\GIS\PollinatorProject\Pollinator\Pollinator.gdb\soil_samples' fields = ['L1_SOILTYP', 'ClassofSoil'] type_to_class = { 'CLAY, DUMP': '1', 'DRY CLAY': '1', 'Clay' : '1', 'CLAY' : '1', 'CLAY MOIST' : '1', 'CLAY(WEATHERED SHALE)' : '1', 'FILL, CLAY' : '1', 'SAND' : '2', 'TOO SANDY' : '2', 'Sand, coarse' : '2', 'COARSE SAND' : '2', 'Sand' : '2', 'CLEAN SAND' : '2', 'VERY SANDY' : '2', 'SANDY' : '2', 'FINE SAND' : '2', 'Fine Sand' : '2', 'COURSE SAND' : '2', 'Coures Sand' : '2', 'Sandy Clay' :'3', 'SAND & CLAY' :'3', 'SAND SOME CLAY' :'3', 'Clayey Sand' :'3', 'CLAY SOME SAND' :'3', 'CLAY,SOME SAND' :'3', 'Sandy Caly' :'3', 'SANDY CLAY' :'3', 'COURSE SAND SOME CLAY' :'3', 'SILT' : '4', 'Silit' : '4', 'SILTY' : '4', 'Silty' : '4', 'Silt' : '4', 'MEDIUM' : '5', 'FIRM' : '5', 'NO DUMP' : '5', 'SLAB/PLASTIC' : '5', 'DUMP' : '5', 'Dump' : '5', 'TRACES OF DUMP' : '5', 'SLAB' : '5', 'SOME DUMP' : '5', 'SOME WOOD' : '5', 'REJECTION' : '5', 'TO 6(2)' : '5', 'VERY SOFT' : '5', 'WOOD' : '5', '2)' : '5', 'VERY DAMP' : '5', 'FILL' : '5', 'SLAG': '5', 'ASPHALT/FILL' : '6', 'ASPHALT' : '6', 'asphalt is newer' : '6', 'asphalt is new' : '6', 'Gravel & Sand' : '7', 'SAND & GRAVEL (STRUCTURAL FILL' : '7', 'SILTY GRAVEL & SAND' : '7', 'GRAVLE & SAND' : '7', 'Sand w/ Gravel' : '7', 'COURSE SAND & GRAVEL' : '7', 'Sand w/ gravel' : '7', 'SAND & GRAVEL' : '7', 'GRAVEL & SAND' : '7', 'CLAYEY SAND & GRAVEL' : '7', 'Sand & Gravel' : '7', 'SAND & gRAVEL' : '7', 'Sand & Pea Gravel': '7', 'SAND & GRAVEL SOME CLAY' : '7', 'Gravel Ballast' : '8', 'LARGE GRAVEL' : '8', 'GRAVEL' : '8', 'SiltyClay' : '9', 'Clayey Silt' :'9', 'SILTY CALY' : '9', 'SILTY CLAY' : '9', 'CLAYEY SILT' : '9', 'GRASS/TOPSOIL' :'10', 'TOP SOIL' :'10', 'CLAY & GRAVEL' :'11', 'Sandy Clay & Gravel' :'11', 'DUMP, BRICK' : '12', 'CONCRETE' : '12', 'RED BRICK' : '12', 'BRICK' : '12', 'SAND SOME BRICK' : '12', 'Silty Sand' : '13', 'Sandy Silt' : '13', 'SAND & SILT' : '13', 'SANDY SILT' : '13', 'SILTY SAND' : '13', 'FINE SAND SILTY' : '13', 'BASALT & SHALE' : '14', 'SHALE' : '14', 'BROWN SHALE' : '14', 'CLAY, CINDERS' : '15', 'CINDERS & SILT' : '15', 'CINDERS' : '15', 'SANDSTONE' : '16', 'CLAYEY SANDSTONE' : '16', 'ROCK' : '17', 'LOAM' : '18', 'n/a' : '<NULL>', ' ' : '<NULL>' } missing_types = [] with arcpy.da.UpdateCursor(fc,fields) as cursor: for row in cursor: if row [0] in type_to_class: row[1] = type_to_class[row[0]] cursor.updateRow(row) else: missing_types.append(row[0]) if len(missing_types)>0: print('Cant find soil types: {0}'.format(set(missing_types))) ```
row[1] = options[row[0]] if row[0] in options else None. Then you can debug your assignment issues.