If I have a table with a number of columns [col1, col2, col3 ... col_n] how to perform multiplication of each column with one selected column, for example:
multiplication = col1 * col_def, col2 * col_def, col3 * col_def ... col_n * col_def
and then to determine the sum, for example:
sum_multiplication = Sum (multiplication)
I try as follows, but does not go:
with arcpy.da.UpdateCursor(fc, (fieldNameList)) as cursor: for row in cursor: for i in range(len(fieldNameList)): hi = sum(row[i] * row) row = hi cursor.updateRow(row)
Does anyone have an idea how to solve this problem?