I am trying to update one field with values as multiples of five till the maximum for the value in the gridcode. The field I am trying to populate is called Time_min. As I am very new to python, am not able to understand where the mistake is. The overwrite is on, so it should not have any problems accessing the file. Please let me know if there are better alternatives.
rows = arcpy.UpdateCursor("CalculateT") i = 5.0 time_min = Raster("time_min") m = time_min.maximum for row in rows: while i <= m: if row.getValue("gridcode") <= i: row.setValue("Time_min", i) rows.updateRow(row) i = i + 5 del row del rows
I have also thought of putting the algorithm as checking divisible by 4 or not; but I need to know if this is normal or an error in my part.