Numpy linalg cond() function computes the condition number of a matrix. The cond() function is capable of returning the condition number using one of seven different norms, depending on the value of p.

Numpy linalg cond()

Numpy linalg cond() is used to find the condition number of the matrix. The linalg cond() function returns the condition number using one of the 7 norms and the return value depends upon the given value below:

  1. None: 2-norm, computed directly using the SVD
  2. ‘fro’: Frobenius norm
  3. Inf: max(sum(abs(x), axis=1))
  4. -inf: min(sum(abs(x+), axis=1))
  5. 1: max(sum(abs(x), axis=0))
  6. -1: min(sum(abs(x), axis=0))
  7. 2: 2-norm (largest sign value)
  8. -2: smallest singular value

Syntax

numpy.linalg.cond ( array, condition_value)

#python #numpy

Numpy Linalg Cond() Function Example
1.80 GEEK