Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Use UpdateCursor to update field based on a change in another field

$
0
0
Hi,

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 table I want to achieve attached: Attachment 29165

The PASS_NUM field does not increment by 1 each time (i.e. it may skip 7) but the I want to TPN to only go up one. Is this possible using the UpdateCursor in arcpy? Or is there another way to achieve this?

Thanks much!
Attached Thumbnails
Click image for larger version

Name:	example.JPG‎
Views:	N/A
Size:	14.1 KB
ID:	29165  

Viewing all articles
Browse latest Browse all 2485

Trending Articles