Hi,
here is a code snippet that is supposed to calculate Value2 by multiplying Wfactor and Value1 for identical object ID's.
Unfortunately the line with "Value2 =" casts a function object is not iterable error. I am stumped on where it is coming from.
Sorry, I think my indentation got all messed up.
Happy 4th of July to everyone (in advance)!
here is a code snippet that is supposed to calculate Value2 by multiplying Wfactor and Value1 for identical object ID's.
Unfortunately the line with "Value2 =" casts a function object is not iterable error. I am stumped on where it is coming from.
Code:
testDict = {}
for test in helps.getUniqueValues(fc,"ID"):
Value2 = ([c.getValue("Value1")*c.getValue("Wfactor") for c in arcpy.SearchCursor if c.getValue("ID") == test])
testDict[t] = Value2
cur = arcpy.UpdateCursor(fc)
for row in cur:
row.setValue("Value2",testDict[row.getValue("ID")])
cur.updateRow(row)
Happy 4th of July to everyone (in advance)!
Comment