Answers for "check if a numpy array contains only 1's python"

0

check if a numpy array contains only 1's python

>>> import numpy as np
>>> array=np.array([[1,1,1],[1,1,1],[1,1,1]])
>>> array([[1, 1, 1],
       	   [1, 1, 1],
           [1, 1, 1]])
>>> np.all(array == 1)
>>> True
Posted by: Guest on December-06-2020

Code answers related to "check if a numpy array contains only 1's python"

Python Answers by Framework

Browse Popular Code Answers by Language