POST
|
Thanks for the answer Joe. Your tip worked perfectly for me! Michael Surber Dallas, Texas
... View more
10-30-2017
09:17 AM
|
0
|
0
|
1657
|
POST
|
Thanks for the reminder Mitch. I do often forget that !
... View more
07-31-2017
11:36 AM
|
0
|
0
|
514
|
POST
|
Thanks very much for your input Dan. I review the content of your link.
... View more
07-31-2017
10:43 AM
|
0
|
0
|
514
|
POST
|
Thanks for the speedy reply Rebecca ! It's for a work problem and using a cursor to check each row of an attribute table is the only way I know how .... I will review the link you provided. Thanks very much!
... View more
07-31-2017
10:29 AM
|
0
|
2
|
514
|
POST
|
I'm trying to create a script that will traverse through a giant attribute table (comprised of the records of 68 polygons), and total up the values in a particular field for features within each polygon. I want the script to go through the table, look for polygon 1 records, add all values in the "Grand_Tota" field, the move on to looking for all records that comprise polygon 2, and so on. I haven't used Lists too often so perhaps my problem lies there. When I run the code now, it just spits keeps spitting out the first total (5). Each polygon feature is weirdly named "Location X : 0 - 5" where X is the loc number. #====================================================================== import arcpy fc = "C:\Users\surbemi\Desktop\New folder\Export_Output.shp" field = "Grand_Tota" sCursor = arcpy.SearchCursor(fc) loc = 1 polyName = "Name" # Names are formatted ("Location X : 0 - 5") where X = loc sum = 0 total = [] while loc < 21: for row in sCursor: if row.getValue(polyName) == "Location " + str(loc) + " : 0 - 5": i = row.getValue(field) sum = sum + i total.append(sum) print "Location " + str(loc) + " Total: " + str(int(total[loc-1])) sum = 0 loc = loc + 1 #======================================================================
... View more
07-31-2017
09:19 AM
|
0
|
6
|
737
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|