Attempting to add up values of one field based on the value of another field. The first cursor adds up the values in the field correctly, but the second one uses the first value of the first cursor resulting in a wrong total. If I replace the code "totalPrice1 = (Row)" with "totalPrice1 = 0.0", it just skips the first value entirely. I think the error lies in this code in the second cursor "totalPrice2 = (Row)" because it seems to set the value to the first value in the first cursor instead of the first value in the second. ideas?
Fields = ['Field1','Dollar Value'] FirstCursor = arcpy.da.SearchCursor(fcName,Fields) for Row in FirstCursor: totalPrice1 = (Row) for Row in FirstCursor: if Row == "Example 1": totalPrice1 += (Row) del Row del FirstCursor SecondCursor = arcpy.da.SearchCursor(fcName,Fields) for Row in SecondCursor: totalPrice2 = (Row) # Something needs to be changed here to get the first value correct for Row in SecondCursor: if Row == "Example 2": totalPrice2 += (Row) del Row del SecondCursor