I am trying to duplicate values from the first row of my table to the other rows.
This screenshot is showing my first row with values 75, 226 and 86.
I would like to copy these values into other 6 rows and make it look like the one below;
I can do this manually by entering the first value into the field calculator (do it for each fields). However, I am trying to build a model that does it automatically. I am trying to find a tool that takes the value from first row and assigns to the others.
import arcpy table = r'path to table' with arcpy.da.SearchCursor(table, ['Arsons','Burglaries','Assault']) as cursor: for row in cursor: if row is not None: row0value = row if row is not None: row1value = row if row is not None: row2value = row arcpy.CalculateField_management(table, "Arsons", row0value) arcpy.CalculateField_management(table, "Burglaries", row1value) arcpy.CalculateField_management(table, "Assault", row2value)
This is assuming all data in the table is Null except for the value wanting to be copied. I haven't tested it.