X is given as below:
X = np.array([-1, 2, 0, -4, 5, 6, 0, 0, -9, 10])
My answer is: any(X==0).
But the standard answer is X.any(), and it returns True, which confuses me.
For me, X.any() is looking for if there is any True or 1 in the array. In this case, since there is no 1 in the given X array, it should have returned False. What did I get wrong? Thank you in advance!
X.any()is looking for if there is anyTrueor1in the array" - please RTM: numpy.org/doc/stable/reference/generated/numpy.any.html(X==0).any()X.anyactually does.