I have a 2D numpy.array, which should act as indices for another, so it should contain only ints or bools. Is there a quick and elegant (one line) way for checking for this condition?
I've tried the following code, but it does not provide the desired output, as it only checks for 0s and not for Nones, which is the value present in my case:
Example 1:
a = np.array([[1, 2, 3], [3, 4, 5]])
np.all(type(a) == np.int64, axis=0)
Current Output 1:
False
Example 2:
b = np.array([[1, 2, None], [3, 4, 5]])
np.all(type(a) == np.int64, axis=0)
Current Output 2:
False
so in the first example I'd like to get True as an output, as all the values of this array are numeric, while in example 2 - I'd like to get false, as there is a None value present in the first row of b array.
Appreciate any help.