Continually to
Changing 1000 values in attribute table using ArcPy?
Change specific rows in attribute table using Arcpy in ArcGIS 10.3
I try to change 850 different values in attribute table of point layer into value "red use" (the total features in this layer is 1300).
I need to change FID start from 300 til FID 1150 and using this code:
import arcpy
lyrName = r"G:\desktop\Project\lyr\point1.shp"
with arcpy.da.UpdateCursor(lyrName, ["name", "FID"]) as cursor:
for row in cursor:
if row[1] in (0, 1, 2):
row[0] = 'no land use'
cursor.updateRow(row)
print """Updated row {}""".format(row[1])
Line number 6 is the rows that should be changed. I understand that row
if row[1] in (0, 1, 2):
should be change- but i don't how. How can i changed those 850 row with python code, based on FID field?