Consider (simplified)
low_count = 0
high_count = 0
high = 10
low = 5
value = 2
What is a clean way to check a number value
versus a min low
and a max high
, such that if value
is below low
low_count
increments, and if value
is above high
high_count
increments? Currently I have (code snippet)
high_count = 0
low_count = 0
low = spec_df['Lower'][i]
high = spec_df['Upper'][i]
#Calculate results above/below limit
for result in site_results:
if result<low:
low_count+=1
else:
if result>high:
high_count+=1
Thanks!
elif
instead ofelse:\nif
. \$\endgroup\$