Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

replace matrix values python

>>> A = np.array((1,7,3,8,4,9,1))
>>> np.where(A>4,1,A)
array([1, 1, 3, 1, 4, 1, 1])
Source by moonbooks.org #
 
PREVIOUS NEXT
Tagged: #replace #matrix #values #python
ADD COMMENT
Topic
Name
8+2 =