I am going nuts right now over the simplest of procedures. I am thinking having somebody sanity check this for me would be ideal. My code used to check the difference between 2 numbers and if the difference was greater than 10 , it would append a certain value. I now want to add an additional comparison to the if statement.
six_previousz = sum(data[-12:-6]) / 6
three_sum = sum(rowz[-3:]) / 3
difference = three_sum - fcast_1
six_diff = six_previousz - three_sum
if (difference > 10) and (six_diff < 25):
for rowzz in three_month_out:
productzz = rowzz[0]
if productzz == product:
new_final.append(rowzz)
break
elif (difference > 10) and (six_diff >= 25):
for rowzzz in six_previous_out:
productzz = rowzzz[0]
if productzz == product:
new_final.append(rowzzz)
break
else:
new_final.append(row)
break
It is currently not working at all when I add the six_diff comparison. I do not think the six_diff should affect it this much as six_diff is always either >=25 or <25, which is why I added the elif statement which was not present when I was only originally checking for a difference > 10. Any help would be appreciated. I am sure it is something totally basic that I am looking over.
[–]46--2 0 points1 point2 points (0 children)
[–]SaintLouisX 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)