I am only in the beginning stages of learning Python.
I have a column, 'QUANTITY_SOLID', that I want to take the sum of all of its rows. I understand I can do this with 'SUMMARY_STATISTICS', but i'm not trying to create another entire table nor do anything other than simply SUM up that column. Once I have it summed up, I want to insert the sum into a new NULL field that I have created – I am attempting to do this via the 'CALCULATE_FIELD' tool.
Best Answer
Cursors are the way to go for this type of problem.
First, create a list of values using a Search Cursor and a generator expression:
Then run an Update Cursor to populate the
QUANTITY_SOLID_SUM
field:Finally, update the rows with the value from the generator