[Numpy-discussion] runtime warning in linalg.det

josef.pktd at gmail.com josef.pktd at gmail.com
Sat Jan 27 22:33:55 EST 2018


I'm trying to figure out some warnings in the statsmodels test suite

Why do the following raise RuntimeWarnings?


np.linalg.det(np.ones((3,3)))

C:\...\python-3.4.4.amd64\lib\site-packages\numpy\linalg\linalg.py:1776:
RuntimeWarning: invalid value encountered in det
  r = _umath_linalg.det(a, signature=signature)
Out[21]: 0.0



np.linalg.det(np.zeros((3,3)))

C:\...\python-3.4.4.amd64\lib\site-packages\numpy\linalg\linalg.py:1776:
RuntimeWarning: invalid value encountered in det
  r = _umath_linalg.det(a, signature=signature)
Out[22]: 0.0

np.__version__
Out[23]: '1.11.2'


and is there a way to distinguish those from user problems

a = np.ones((3,3))
a[1,1] = np.nan
np.linalg.det(a)

C:\...\WinPython-64bit-3.4.4.5Qt5\python-3.4.4.amd64\lib\site-packages\numpy\linalg\linalg.py:1776:
RuntimeWarning: invalid value encountered in det
  r = _umath_linalg.det(a, signature=signature)
Out[26]: nan


Josef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180127/a42744b0/attachment.html>


More information about the NumPy-Discussion mailing list