import numpy as np
print("Original array:")
nums = np.random.randint(0,3,(4,10))
print(nums)
print("\nTest whether the said array has null columns or not:")
print((~nums.any(axis=0)).any())
Sample Output:
Original array:
[[1 2 1 1 1 2 1 1 2 0]
[1 1 0 0 0 0 2 1 2 0]
[0 0 2 1 0 2 2 2 2 2]
[1 1 1 2 0 0 0 0 1 2]]
Test whether the said array has null columns or not:
False
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer