Using an cursor to get a list of unique values, then use those values as variable nam

المشرف العام

Administrator
طاقم الإدارة
I have a table of spatial data, and I can use a search cursor to get a Python list of unique value in one attribute of that table. I can also use the cursor to get the areas of each record (polygons). My table has about 10 unique attributes (representing different areas).What I want to do is sum the areas for each attribute (without creating another table like I could with the Summary Statistics tool).

Can you use an item that is stored as a string in a Python list, extract the item, and use it as a variable declaration?For example-Say I have a list called uniquevalues = ['foo', 'bar'].Can I use uniquevalues[0] to declare a variable? Something likeuniquevalues[0] = 0then later in the code do

foo += areaforthisrecord



أكثر...
 
أعلى