Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy if zero is present

import numpy
array = np.array([0.  , 0.05, 0.25, 0.5 , 0.75])
# is array contain no 0?
np.all(array)
>>> False
# Remove the 0, first element of the array.
array[1:]
>>> array([0.05, 0.25, 0.5 , 0.75])
# is array contain no 0?
np.all(array[1:])
>>> True
 
PREVIOUS NEXT
Tagged: #numpy #present
ADD COMMENT
Topic
Name
1+3 =