Hello E.Z.There are plenty of ways to do this in python. You could use an array of arrays, like this:listOfRecords=[]
with arcpy.da.SearchCursor(fc1, ("CountryID", "Total_Impact"), whereclause) as cursor:
for row in cursor:
# Access and print the row values by index position.
countryName: row.CountryID
envImpact: row.Total_Impact
print('{0} has an impact in {1}'.format(row[0], row[1]))
listOfRecords.append([countryName,envImpact])
#access data
print "Accessing data later in the script!"
for record in listOfRecords:
print('{0} has an impact in {1}'.format(record[0], record[1]))
However, I think a dictionary would work better for you in this case. Something like this:countryDict={}
with arcpy.da.SearchCursor(fc1, ("CountryID", "Total_Impact"), whereclause) as cursor:
for row in cursor:
# Access and print the row values by index position.
countryName: row.CountryID
envImpact: row.Total_Impact
print('{0} has an impact in {1}'.format(row[0], row[1]))
countryDict[countryName]=envImpact
#access data (all records)
print "Accessing data later in the script!"
for country in sorted(countryDict): #sorted() will output the Country in alpha/numeric order
print('{0} has an impact in {1}'.format(country, countryDict[country]))
#access data (one records)
print "Accessing one record!"
print "Canada has a Total Impact of "+str(countryDict["Canada"]) #replace "Canada" with the CountryID for Canada
NOTE: dictionaries do NOT allow duplicate keys. In this case the CountryID must be a unique field.Let me know how it goes!~Josh