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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With