矩阵秩 - 包含更多信息 (python)

Rank of matrix - with more information (python)

我正在处理一个特定的 class n 方矩阵,其中当 n 为偶数时秩为 n,当 n 为奇数时秩为 n-1,我想了解原因。

numpy.linalg.rank 有助于注意到这一事实;但是,为了理解为什么会发生这种情况,我希望我的行(或列)的总和为全零的非零线性组合。

我检查了 numpy.linalg.rank 是如何工作的,它似乎不起作用(或者我不明白我读到的内容 here

我不知道该怎么做。这个问题是否太具体以至于没有现有的功能可以做到这一点?

您正在寻找 Kernel or null space. You can get one basis of it with scipy.linalg.null_space