Using NumPy and attempting to multiply matrices together sometimes doesn't work. For example
import numpy as np x = np.matrix('1, 2; 3, 8; 2, 9') y = np.matrix('5, 4; 8, 2') print(np.multiply(x, y))
Traceback (most recent call last): File "vector-practice.py", line 6, in <module> print(np.multiply(x, y)) ValueError: operands could not be broadcast together with shapes (3,2) (2,2)
I understand that I can't multiply these shapes, but why not? I can multiply these two matrices on paper, so why not in NumPy? Am I missing something obvious here?