AnsweredAssumed Answered

UpdateCursor Lat and Long

Question asked by JenniferSherry on Jun 5, 2017
Latest reply on Jun 5, 2017 by bixb0012

We are currently trying to update existing null values with X and Y coordinates.

We are getting an error:

>>>
Traceback (most recent call last):
File "C:\FLRmodel\CalculatePlotNumberByAccess3.py", line 72, in <module>
row[2] = round(row[0], 6)
TypeError: a float is required
>>> 

with arcpy.da.UpdateCursor(projectedFC, ['SHAPE@X', 'SHAPE@Y', 'PLOT_LONG', 'PLOT_LAT'], "" , spatialRef) as cursor:
    for row in cursor:
        row[2] = round(row[0], 6)
        row[3] = round(row[1], 6)

        cursor.updateRow(row)

Why does it ask for a float? 

Outcomes