forces dating sites uk - Doa updatingtable


You would only use the top for loop: "for row in cursor:".Inside that loop you would just use: "row = listofvalues" or "row = tupleofvalues". Actually now that I have read your list more closely you cannot and should not use the list you have shown using an update cursor.Update Cursor(fc, (field Name List)) as cursor: for row in cursor: if row[0] in my Dict: for n in range(1,len(field Name List)): row[n] = my Dict[row[0[n-1] cursor.update Row(row) The code with the dictionary will only update a maximum of 5 rows and only those rows with an Object ID value of 1, 2, 4, 8 or 10.

||

You would only use the top for loop: "for row in cursor:".

Inside that loop you would just use: "row = listofvalues" or "row = tupleofvalues". Actually now that I have read your list more closely you cannot and should not use the list you have shown using an update cursor.

]]

But you can iterate the list with the row loop as shown below: import arcpy my List = -0.17142857, 2.92857143, 2.76190476, 0.22857143, -0.0952381 ], [ 0.10434783, 1.86335404, -0.39130435, 6, 0.7826087 ], [-0.053125, 4.8875, 0.2125, 3, 0.56666667], [ 0.0730897, 2.55813953, 0, 4.94573643, 0.30697674], [ 0.36, 3.24, 0.24, 2, 0.63 fc = "my FC" field Name List = [u'A', u'B', u'C', u'D', u'E'] i = 0 with

Update Cursor(fc, (field Name List)) as cursor: for row in cursor: i = 1 row = my List[i] cursor.update Row(row) However, there are many failure possibilities with the code above.

For example, a value of 1.0 to a string field will be added as "1.0", and a value of "25" added to a float field will be added as 25.0." Insert cursors use the insert Row(row) method the same way.

It would not involve the two for loops you showed, since you don't access each field in the row with the i counter from the range.

I'm getting this error in red when I try and update.