I am attempting to create a script with arc toolbox in which part of the script populates a probability field based on thresholds on a percentage field. I would like the thresholds for the ranges upon which to classify the probability field to be parameters that the user can input in the tool. However, when I attempt to run the tool, it does not properly update the fields. Instead it fills with the last value (in the case of my script below, it populates everything with "L"). The script runs fine (through toolbox or stand-alone) if I replace the parameters in the script with values. I have tried defining these threshold parameters as "double" or "any value" in arc toolbox, both with no luck. Does anyone know why I am having this problem?
# populate occurrence probability based on percentage thresholds
with arcpy.da.UpdateCursor(zoneTable, ["PERCENTAGE", "probability"]) as cursor:
for row in cursor:
if (row[0] >= highThreshold):
row[1] = "H"
elif (row[0] < highThreshold and row[0] >= medThreshold):
row[1] = "M"
else:
row[1] = "L"
cursor.updateRow(row)
highThreshold = arcpy.GetParameterAsText(2)
medThreshold = arcpy.GetParameterAsText(3)