[pypy-issue] [issue1691] numpy nansum returns 0 when nan in list

Ryan tracker at bugs.pypy.org
Tue Feb 11 21:53:38 CET 2014


New submission from Ryan <welch.ryan at gmail.com>:

Seems like nansum is returning 0 whenever np.nan is present in a list: 

python nansum_bug.py
Answer should be 3.0, got: 3.0
                                                                                                                                                                                                
pypy nansum_bug.py
Answer should be 3.0, got: 0.0

I'm using pypy 2.2.1 with a fresh pull from the numpy bitbucket repo: 

>>>> np.version.full_version
'1.8.0.dev-20902db'
>>>> np.version.git_revision
'20902db0f22b6681fda533d2cb336c7af081ed22'

----------
files: nansum_bug.py
messages: 6537
nosy: pypy-issue, welchr
priority: bug
release: 2.2
status: unread
title: numpy nansum returns 0 when nan in list

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1691>
________________________________________
-------------- next part --------------
import numpy as np

print "Answer should be 3.0, got: %s" % str(np.nansum([0.0,1.0,2.0,np.nan]));


More information about the pypy-issue mailing list