Larz60+ is right that you don'y show enough code, but to me
time in Quantity.shape[0] > 1
and time in Quantity.shape[0] < 50099
do not make senseQuantity.shape[0]
is integer, because otherwise for time in range(Quantity.shape[0]):
would raise an exception, so you cannot iterate time in Quantity.shape[0]
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs