Skip to content

Instantly share code, notes, and snippets.

@mu-777
Created July 31, 2015 03:03
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 mu-777/e47dc68e00886d028f1c to your computer and use it in GitHub Desktop.
Save mu-777/e47dc68e00886d028f1c to your computer and use it in GitHub Desktop.
import numpy as np
# np.matrix and np.mat
m = np.matrix([[1,2],[3,4]])
a = np.matrix(m)
b = np.mat(m)
c = np.matrix(m, copy=False)
# all m, a, b, c is matrix([[1, 2],[3, 4]])
m[0,0] = 10
# all m, b, c is matrix([[10, 2],[3, 4]])
# a is matrix([[1, 2],[3, 4]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment