Change of basis in numpy
问题 Given two basis matrices basis_old and basis_new in numpy, is there a function somewhere in the library to get the transformation matrix to convert a vector vec in basis_old to its representation in basis_new ? For example, if I have a vector vec = [1,2,3] in the standard basis [1,0,0], [0,1,0], [0,0,1] , how to I convert it to another basis, say, e1 = [1 0 0] e2 = [0 0 1] e3 = [0 1 0] basis_new = np.array([e1, e2, e3]) # I want something like this vec_new = np.linalg.change_of_basis(vec_old,