With help of this code I am able to summarize the Area field values of the Geology layer.
list = [r.Area for r in arcpy.SearchCursor(Geology)] # Area is the attribute field that you want to list
How can I bring an if statement into this code? I only want to list the Area field values if the field "Description" == "Silicate"
I am very thankful for any suggestions.
Solved! Go to Solution.
Hi Lara,
You can specify a whereclause in your cursor. This is the second and optional parameter of the function.
Please refer to the help page of the search cursor, and for building the SQL whereclause.
If you are using a 10.1 version or above, you might use data acces module (arcpy.da.SearchCursor) for performance improvement.
Regards.
J.
Hi Lara,
You can specify a whereclause in your cursor. This is the second and optional parameter of the function.
Please refer to the help page of the search cursor, and for building the SQL whereclause.
If you are using a 10.1 version or above, you might use data acces module (arcpy.da.SearchCursor) for performance improvement.
Regards.
J.
Thanks that worked!:)