Calculate statistics for selected features and pass to a variable

492
2
05-21-2021 07:15 AM
Status: Open
d484648
New Contributor III

The analysis.Statistics tool calculates statistics for selected rows but puts the value in a CSV table. I want to be able to calculate the sum of values in a field for selected rows and then use the sum elsewhere in my Python Script.

2 Comments
DuncanHornby

Just use a searchcursor if you want to read values from a selection, or you could call the summary statistics tool.

d484648

Thanks for the reply.

The summary statistics tool generates a CSV file for each sum. I don't need that.

I'll have to look up how to read and create a running sum of values from a selection using a searchcursor.