diff --git a/source/exercises100.ktx b/source/exercises100.ktx index cba706d..d1e1700 100644 --- a/source/exercises100.ktx +++ b/source/exercises100.ktx @@ -1148,7 +1148,7 @@ print(R) Compute a matrix rank (★★★) < h82 -hint: np.linalg.svd +hint: np.linalg.svd, np.linalg.matrix_rank < a82 # Author: Stefan van der Walt @@ -1158,6 +1158,12 @@ U, S, V = np.linalg.svd(Z) # Singular Value Decomposition rank = np.sum(S > 1e-10) print(rank) +# alternative solution: +# Author: Jeff Luo (@Jeff1999) + +rank = np.linalg.matrix_rank(Z) +print(rank) + < q83 How to find the most frequent value in an array?