I am trying to update a field "TPN" based on another field "PASS_NUM". In my script "TPN" is a newly added number field and thus blank, "PASS_NUM" is also a number field but it contains the wrong numbers. I want to assign values to "TPN" when "PASS_NUM" is no longer equal the the value in the row above it. The feature class table is sorted by "PASS_NUM". See example of attribute table I want to achieve here:
Is there any way to check if the value in the row above is equal to the next value (some sort of onchange event)?
The PASS_NUM field does not increment by 1 each time (i.e. it may skip 7 as in the example) but I want to TPN to only go up one.
Is this possible using the UpdateCursor in arcpy?