[Numpy-discussion] bug with numpy nanargmax/nanargmin

Dmitrey tmp50 at ukr.net
Tue Apr 5 05:33:54 EDT 2011


 >>> from numpy import *
   >>> nanargmax([nan,nan])
   nan # ok
   >>> nanargmax([nan,nan],0)
   nan # ok
   >>> nanargmax([[1,nan],[1,nan]],0)
   Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File
   "/usr/local/lib/python2.6/site-packages/numpy/lib/function_base.py",
   line 1606, in nanargmax
   return _nanop(np.argmax, -np.inf, a, axis)
   File
   "/usr/local/lib/python2.6/site-packages/numpy/lib/function_base.py",
   line 1346, in _nanop
   res[mask_all_along_axis] = np.nan
   ValueError: cannot convert float NaN to integer
   >>> __version__
   '2.0.0.dev-1fe8136'

   D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110405/48614f97/attachment.html>


More information about the NumPy-Discussion mailing list