Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Built in Numpy Exceptions?

In numpy are there any generic exceptions that can be called? From numpy docs I only saw specific ones such as LinAlgError

For example, I know that Python has these error types built in:

  • Exception
  • StandardError
  • ArithmeticError
  • ImportError
  • IndexError
  • KeyError
  • NotImplementedError

etc.

like image 294
Eiyrioü von Kauyf Avatar asked Aug 19 '12 15:08

Eiyrioü von Kauyf


1 Answers

No, LinAlgError doesn't inherit from anything. It's a generic error for when the linear algebra fails.

>>> numpy.linalg.LinAlgError.__bases__
(<type 'exceptions.Exception'>,)

If you explain the particular circumstances under which you would like to raise this 'generic exception', we might be able to suggest what to use.

like image 55
Katriel Avatar answered Oct 05 '22 08:10

Katriel