I just want to check if a numpy array contains a single number quickly similar to contains for a list. Is there a concise way to do this?
a = np.array(9,2,7,0)
a.contains(0) == true
You can use 0 in a
. i.e
a = np.array([9,2,7,0])
0 in a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With