I have the following and I having a hard time by passing some blank attributes. I know what the problem is, the problem is that row Pin has blanks and when the codes tries to populate the Permits row it throws the 'The row contains a bad value' Error. It's trying to bunch all of 'P_num' that have a blank into the Permits row. How can I get passed this?
dict1 = dict()
with arcpy.da.SearchCursor(fc,['Pin','Perm_COUNT','P_Num']) as cursor:
for row in cursor:
if row not in (None, "", " "):
dict1.setdefault(row[0],[]).append(str(row[2]))
#print (dict1)
with arcpy.da.UpdateCursor(fc,['Pin','Perm_COUNT','Permits']) as cursor:
for row in cursor:
row[2] = ",".join(dict1[row[0]])
#print (",".join(dict1[row[0]]))
cursor.updateRow(row)