[SciPy-User] Bottleneck

Fabrice Silva silva at lma.cnrs-mrs.fr
Tue Nov 30 20:09:04 EST 2010


Le mardi 30 novembre 2010 à 16:13 -0800, Keith Goodman a écrit :
> That's a great test!
> 
> Could it be that older version of scipy.stats.nanstd can't handle
> negative axes? In case that's the problem I added ndim to negative
> axes before passing to scipy.stats.nanstd in the latest commit. Care
> to try it?
        
        In [12]: sp.nanstd(a, axis=-1)
        ---------------------------------------------------------------------------
        ValueError                                Traceback (most recent call last)
        /home/fab/<ipython console> in <module>()
        /usr/lib/python2.6/dist-packages/scipy/stats/stats.pyc in nanstd(x, axis, bias)
            302     if axis!=0:
            303         shape = np.arange(x.ndim).tolist()
        --> 304         shape.remove(axis)
            305         shape.insert(0,axis)
            306         x = x.transpose(tuple(shape))
        
        ValueError: list.remove(x): x not in list


In fact -1 is not in the generated list (l303)

See http://projects.scipy.org/scipy/ticket/1161 (closed), but the fix
did not reach my machine by now...

-- 
Fabrice Silva




More information about the SciPy-User mailing list