jeudi 27 octobre 2016

How to loop inside a nd.array in Python

I have a N Dimensional array = X, I want to check each value in X if it is greater than 0.35 . I write as :-

for number in X:
    if (.35> number):  # Here error occurs
        print (enumerate(number))

But I get this error:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Aucun commentaire:

Enregistrer un commentaire