[GIS] Edit Field Value of Feature Class Using Python in ArcGIS 10.2

arcgis-10.2arcgis-desktopattribute-tablepython

I have a feature class whose attribute table looks like this:

Latitude | Longitude | Area

For the area column, all rows are null. I would like to put in a specific value for all rows using Python.

I know how to do this on the front-end in the ArcMaps application ( right click > Open Attribute Table > right click on column > field calculator > input value).

How can I accomplish this programmatically using Python?

Best Answer

You can calculate the values for a column with Python by using either a GP tool Calculate Field or arcpy UpdateCursor (this one is faster when working with large datasets).

For calculating the geometrical properties of features, you can either use GP tool Add Geometry Attributes or using tokens (such as SHAPE@AREA) of update cursor.

Related Question