python里怎么求一个矩阵或者numpy.array的秩?
1个回答
numpy.linalg.matrix_rank(M)可以用求秩
>>> import numpy as np
>>> A = np.array([[1, 1], [2, 2]])
>>> A
array([[1, 1],
[2, 2]])
>>> np.linalg.matrix_rank(A)
1
python里怎么求一个矩阵或者numpy.array的秩?
numpy.linalg.matrix_rank(M)可以用求秩
>>> import numpy as np
>>> A = np.array([[1, 1], [2, 2]])
>>> A
array([[1, 1],
[2, 2]])
>>> np.linalg.matrix_rank(A)
1