I would like to change one field values into negative (i.e. original column, row 1 = 5, new column row 1 = -5 in a feature class list.
I got until the addfield and calculate field functions, but it is not clear how to do the negative transformation.
ARCGIS help page has some instructions about negative expressions
-x, negative expression of x, x = 5 --> -x, -5
How to use it with arcpy
is not very clear. It seems that an expression should be added either at the '!original_value!' or as a code block after the expression type (python 9.3).
for fc in arcpy.ListFeatureClasses():
#output = path.join(outWS, fc)
#"GEODESIC" calculates distances in meters!
#arcpy.analysis.Near(fc, idFeat, "", "NO_LOCATION", "NO_ANGLE","GEODESIC")
arcpy.AddField_management(fc, 'location_value', "FLOAT")
arcpy.CalculateField_management(fc, 'location_value', '!original_value!', "PYTHON_9.3", "")