jeudi 22 mars 2018

Count a if-statement inside a forloop

I need to count how many times a value between 0 and 0.1 occurs in Axis (float64). The code I was trying to write looks like this but nothing happens. Can anyone help me with this matter?

for x in Axis:
    if x>0 and x<0.1 in Axis:
        count(x)
        print(x)
        Class1=count(x)/2257
    else:
        Class1='nan'

Aucun commentaire:

Enregistrer un commentaire