Skip to content

Instantly share code, notes, and snippets.

@jakkaj
Created October 12, 2017 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakkaj/61ea9a770f9f7c7772c6ddd162bb8ac9 to your computer and use it in GitHub Desktop.
Save jakkaj/61ea9a770f9f7c7772c6ddd162bb8ac9 to your computer and use it in GitHub Desktop.
Multiply two matrices in Python (matrix transform)
import numpy as np
Y = [[0,1,2],
[3 ,4,5],
[6 ,7,8]]
X = [[0,-2,2],
[5,1,5],
[1,4,-1]]
matX = np.matrix(X)
matY = np.matrix(Y)
result = matX * matY
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment