I'm trying to find a way of adding <Null> to a record when there a change in the data sequence on another field attribute...?
I've been trying to adapt this code to achieve this, but I'm struggling.
import arcpy
from arcpy import da
vertices = "dataset"
#set firstRow variable to true
firstRow = True
with arcpy.da.UpdateCursor(vertices, ["Shape", "Line_ID", "angle"]) as cursor:
for row in cursor:
name2 = row[1]
#check if its the first row
if firstRow == True:
name1 = name2
#set firstrow to false
firstRow = False
continue
row[2] = str(name1 - name2)
name1 = name2
cursor.updateRow(row)
The result should be something like this:
I'm rather new to UpdateCurser, so, generally don't know how it works.