Hi,
So I am having an issue where every time I try to create a list, either using a comprehension or other, that returns the error of either 'NoneType' is not subcriptable or iterable. I have tried multiple methods to bypass this error, but it seems that this error persists somewhere and I can't figure out where.
#Get Field Indexes
OIN = SelectedTempFields.index('ORIG_FID')
VIN = SelectedTempFields.index('ValveID')
DIN = SelectedTempFields.index('LAND_DIST')
LIN = SelectedTempFields.index('LAND_LOT_1')
#Create Dictionary Of Specific Values
CreatedTempList = {}
#Gather Created Temporary Polygon Layer Values
for DLL in DistrictsAndLandLots:
District = DLL[0]
Landlot = DLL[1]
DistText = str(District).zfill(2)
LandText = str(Landlot).zfill(4)
DistLandText = DistText + LandText
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and row[VIN][-1] is int()]
if values:
print (sorted(set(values)))
CreatedTempList[DistLandText] = max(values)
for key, values in CreatedTempList.items():
print (key, ': ', values)
small snippet of the code
I also seem to be getting two error codes simultaneously, which is a bit odd, and I am not sure exactly how this error is occurring.
Traceback (most recent call last):
File "U:\Models_Tools\Scripts for Water and Sewer Database\Update Valve ID Field.py", line 101, in <module>
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and row[VIN][-1] is int()]
File "U:\Models_Tools\Scripts for Water and Sewer Database\Update Valve ID Field.py", line 101, in <listcomp>
values = [row[VIN][-3:] for row in arcpy.da.SearchCursor(CreatedTemp, SelectedTempFields) if row[DIN] == District and row[LIN] == Landlot and row[VIN][-1] is int()]
TypeError: 'NoneType' object is not subscriptable
Any help on this would be greatly appreciated.