Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Essentially I am trying to calculate a value for a couple of fields after adding them. Below you can see how I am adding the fields and then an example on how my "for" statement is looping through the cursors to add values.

I keep getting an error: "TypeError: sequence size must match size of the row"

I'm not sure what to do about this. Is there a better method than to use the UpdateCursor updateRow statements?

fieldName = ["azVEqSet", "azVERis"]
    arcpy.AddField_management(points, fieldName[0] ,"FLOAT")
    arcpy.AddField_management(points, fieldName[1] ,"FLOAT")
    arcpy.DeleteField_management(points, [fieldName[0], fieldName[1]])
    arcpy.AddField_management(points, fieldName[0] ,"FLOAT")
    arcpy.AddField_management(points, fieldName[1] ,"FLOAT")

cursor = arcpy.da.UpdateCursor(points, ["azVEqSet", "azVERis", "POINT_X", "RASTERVALU", "POINT_Y"])
for row in cursor:
     numberInsert = ReturnedVariable
     row[0] = numberInsert
share|improve this question
up vote 8 down vote accepted






  • row, which you obtained from the arcpy.da.UpdateCursor is a sequence (a tuple, specifically) of a certain length expected by the updateRow method, and by wrapping row in brackets, you are creating a new sequence (a list, specifically) of length 1, which is not the length expected.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.