Write a NumPy program to test whether any array element along a given axis evaluates to True.Note: 0 evaluates to False in python.
import numpy as np print(np.any([[False,False],[False,False]])) print(np.any([[True,True],[True,True]])) print(np.any([10, 20, 0, -50])) print(np.any([10, 20, -50]))
Sample Output:
False True True True
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer