SyntaxFix
Write A Post
Hire A Developer
Questions
Using .multiply() (ufunc multiply)
a_1 = np.array([1.0, 2.0, 3.0]) a_2 = np.array([[1., 2.], [3., 4.]]) b = 2.0 np.multiply(a_1,b) # array([2., 4., 6.]) np.multiply(a_2,b) # array([[2., 4.],[6., 8.]])