Created
November 16, 2019 17:01
-
-
Save ntuaha/d7272baf534379be9d9f48333758ace9 to your computer and use it in GitHub Desktop.
神奇計算
要移除指定的 index
可以使用 np.deleteU = np.zeros((N,N)) for i in range(N): lambda_D = np.delete(w, i) denominator = np.prod(w[i]-lambda_D) for j in range(N): M = np.delete(A1, j, 0) M = np.delete(M, j, 1) w2, v2 = np.linalg.eig(M) fraction = np.prod(w[i]-w2) U[j,i] = fraction/denominator
感謝!這個更加簡潔好讀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
要移除指定的 index
可以使用 np.delete