Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python multiply all elements in array by constant

import numpy as np
array1 = np.array([1, 2, 3])
array2 = np.array([[1, 2], [3, 4]])
n = 5
np.multiply(array1,n)
np.multiply(array2,n)
 
PREVIOUS NEXT
Tagged: #python #multiply #elements #array #constant
ADD COMMENT
Topic
Name
2+7 =