Multiply matrices 3 * 2 and 2 * 2

0

Why can not I multiply these two matrices?

c = np.array([[1,0], [2,1],[3,8]])
d = np.array([[3,5], [2,3]])

print c*d

I do not understand what happens, if I do it with my calculator if I can because it is a 3x2 and a 2x2.

I should leave (if I'm not mistaken):

[[3 5]
 [8 13]
 [25 39]] 
    
asked by NEA 04.11.2018 в 16:19
source

1 answer

3

With numpy you can multiply matrices using np.dot in the following way:

c = np.array([[1,0], [2,1],[3,8]])
d = np.array([[3,5], [2,3]])

resultado = np.dot(c, d)

print(resultado)
    
answered by 04.11.2018 / 16:48
source