I was testing out arcpy.da.UpdateCursor to calculate a field based on another fields value. My script runs without error, but doesn't seem to make any changes in the shapefile. I tried adding the line overwriteOutput = "True" but that didn't work. The print line I added for debugging shows the correct values for ReddStatus or row, but they don't get saved in the output.
# Import arcpy module import arcpy from arcpy import env env.workspace = "C:\\avdata\\PythonTest\\" arcpy.env.overwriteOutput = "True" # Local variables: inshape = "zilltogra101013.shp" #input shapefile field1 = "PassNum" #field with test values field2 = "ReddStatus" #field to be calculated fields = ['PassNum', 'ReddStatus'] with arcpy.da.UpdateCursor(inshape, fields) as cursor: for row in cursor: if row == 1: row = "Definite" elif row == 2: row = "Probable" print row,row, '\n'