Hello all - I'm pretty new to Python so I was wondering if anyone could please tell me why my script is returning the following error. Yes, I have looked up the error and its meaning, but am a little unclear on what could be causing it. Thank you in advance!
import arcpy # Define the feature class fc = r'C:\path\to\your\fc' # find the unique 'SEGMENT_LENGTH' values Slist = list() for row in arcpy.da.SearchCursor(fc, 'SEGMENT_LENGTH'): # if the value isn't in the list then add it to the list if not row in Slist: Slist.append(row) for Value in Slist: # definition query to limit the rows in the cursor DefQ = 'SEGMENT_LENGTH = ' + str(Value) # Use a generator expression to populate a list from the 'QUANTITY_SOLID' field b = sum(row for row in arcpy.da.SearchCursor(fc, 'QUANTITY_SOLID')),DefQ with arcpy.da.UpdateCursor(fc, ['QUANTITY_SOLID_SUM'],DefQ) as cursor: for row in cursor: row = b cursor.updateRow(row)
I receive the following error:
Traceback (most recent call last): File "example.py", line 23, in
cursor.updateRow(row) TypeError: value #0 - unsupported type: tuple
Failed to execute (SumFieldInsertNew).