samedi 9 octobre 2021

How to run a range in If / Else Statement?

for i in stock:
    if volume[i] > volume[i+1:10]*150/100

I've pulled a pandas series of 10 'volumes' and wanted to determine the 'volume' which is 150% higher than all of the volume afterward.

But if statement doesn't allow a range inside it. Is there any way to make it work? I'm a beginner, please correct me if I've done anything wrong. Thanks!

Aucun commentaire:

Enregistrer un commentaire