Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

How to update attributes of a shapefile using list values?

$
0
0

I am using an update cursor to update the attributes of a shapefile using values from a list. It seems very easy, but I couldn’t make it run correctly. When I run the following code, it updates all rows based on the final value in the list. Please suggest how to fix it.

cur1 = arcpy.UpdateCursor(fc)
for v in cur1:
    for s in list:
        val = s
        v.Val = val
        cur1.updateRow(v)

Viewing all articles
Browse latest Browse all 767

Trending Articles