How do you calculate fields with null values? I have multiple fields that may have null values, that aren't being calculated in the third field.
import arcpy with arcpy.da.UpdateCursor(r"...gdb\test.gdb\test",["A", "B", "C"]) as cursor: for row in cursor: row = row + row cursor.updateRow(row)
The result of that calculation is this error:
Traceback (most recent call last): File "C:\Users\Desktop\updatecursor2.py", line 4, in <module> row = row + row TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
The result of the script are the same results when I try to use the field calculator:
How do you use the data update cursor, or field calculator to calculate the sum of the values in a new field if you have null values?
I'm using ArcGIS 10.1 SP1 for Desktop.