Adding matrix 2 and Multiplying 2 in python using scipy / numpy

I am trying to use scipy and numpy to do matrix addition and multiplication.

I have 2 matrices "a" and "b". my goal is to add "a" and "b" together and store the result in the matrix "c"

I also want to multiply "a" and "b" and store in the matrix "d".

Is there any function executed in Scipy / Numpy?

Many thanks.

+7
source share
1 answer

Matrix Multiplication:

a = numpy.matrix(a) b = numpy.matrix(b) c = a+b d = a*b 

Array multiplication (map.mul operator):

 a = numpy.array(a) b = numpy.array(b) c = a+b d = a*b 
+10
source

All Articles