I would like to get a script running much faster than it is now. The script completes on my machine in about 33 minutes. It generates a report that counts features with specific attributes in one field. What I think is generally the problem to be solved is that there are 7 features classes in 70+ datasets, with 4 possible entries in the field that I want counted separately.
Here is a very reduced and plain version of the code, it shows generally the structure of the nested cursor in some nested for loops. I wonder if it is possible to NOT have the cursor creation be this nested??
state_plane_list = [...] feature_class_list = ['PRCL_POL_',...] clause = ["RESEARCH_STATUS = 'NULL'",...] for state_plane in state_plane_list: for feature_class in feature_class_list: for rstatus in clause: cursor = arcpy.da.SearchCursor(feature_class + state_plane, fields, str(rstatus)) ***Counting code here - everything ends up in a dictionary and eventually gets written to a csv using DictWriter() ****
Basically, is there another...hopefully more efficient... way to do this?? I feel like creating 1600+ cursor objects may be way too dense a procedure.