1

examples:

for field in arcpy.ListFields(fc):
    if field.name != 'Hi': 
        arcpy.AddField_management(fc, 'Hi', 'FLOAT')
    else:
        print "kolona Hi vec postoji"

with arcpy.da.UpdateCursor(fc, (fieldNameList)) as cursor:

    for row in cursor:

                hi = sum(np.array([row[i]/(sum([row[i] for i in range(len(fieldNameList))])) for i in range(len(fieldNameList))])**2)
                row[14] = hi # row[LAST] = hi ?????

                cursor.updateRow(row)

    del row
    del cursor

That instead of row[14] use the last column of the defined list? examples:

row[last] = hi
3

Try the last element list selector used in Python:

row[-1] = hi
  • Thanx @Richard Morgan... I solved... great.. – kamfulebu Mar 7 '15 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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