Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

binarize array python

np.where(a>threshold, upper, lower)
Out[6]: 
array([[0, 1, 1, 1],
       [1, 1, 0, 1],
       [0, 1, 0, 1],
       [1, 0, 0, 1]])
 
PREVIOUS NEXT
Tagged: #binarize #array #python
ADD COMMENT
Topic
Name
2+5 =