Skip to main content
added 449 characters in body
Source Link

enter image description here

I try to sum all record in "AREA" field and put a value in "SUM" field for calculate a "Ratio" field by using Python.

But I struck in a sum part.

Here is my code :

arcpy.AddField_management(outclip, "AREA", "DOUBLE", 2, "", "", "", "", "")
arcpy.AddField_management(outclip, "SUM", "DOUBLE", 2, "", "", "", "", "")
arcpy.AddField_management(outclip, "Ratio", "DOUBLE", 2, "", "", "", "", "")

arcpy.CalculateField_management(outclip ,'AREA','!shape.area@SQUAREKILOMETERS!','PYTHON')
#arcpy.CalculateField_management(outclip ,'SUM', ['AREA', 'SUM'])','PYTHON')

enter image description here

I try to sum all record in "AREA" field and put a value in "SUM" field for calculate a "Ratio" field by using Python.

But I struck in a sum part.

enter image description here

I try to sum all record in "AREA" field and put a value in "SUM" field for calculate a "Ratio" field by using Python.

But I struck in a sum part.

Here is my code :

arcpy.AddField_management(outclip, "AREA", "DOUBLE", 2, "", "", "", "", "")
arcpy.AddField_management(outclip, "SUM", "DOUBLE", 2, "", "", "", "", "")
arcpy.AddField_management(outclip, "Ratio", "DOUBLE", 2, "", "", "", "", "")

arcpy.CalculateField_management(outclip ,'AREA','!shape.area@SQUAREKILOMETERS!','PYTHON')
#arcpy.CalculateField_management(outclip ,'SUM', ['AREA', 'SUM'])','PYTHON')
deleted 38 characters in body; edited tags; edited title
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

How to sum Summing all record in field and put aputting value in new field

enter image description here

I try to sum all record in AREA"AREA" field and putaput a value in SUM"SUM" field for calculate a Ratio"Ratio" field by using pythonPython.

But iI struck in a sum part.

Any suggestion.

Thank you in advance.

How to sum all record in field and put a value in new field

enter image description here

I try to sum all record in AREA field and puta value in SUM field for calculate a Ratio field by using python

But i struck in a sum part.

Any suggestion.

Thank you in advance.

Summing all record in field and putting value in new field

enter image description here

I try to sum all record in "AREA" field and put a value in "SUM" field for calculate a "Ratio" field by using Python.

But I struck in a sum part.

Source Link

How to sum all record in field and put a value in new field

enter image description here

I try to sum all record in AREA field and puta value in SUM field for calculate a Ratio field by using python

But i struck in a sum part.

Any suggestion.

Thank you in advance.