matrix transpose using numpy code example Example: transpose of a matrix using numpy M = np.matrix([[1,2],[3,4]]) M.transpose()