[SciPy-user] histogram bug ?

Gary pajer at iname.com
Fri Dec 30 13:08:08 EST 2005


WinXP, scipy_core version 0.9.0.1713

tried to call scipy.histogram with the default bins=10. See below.


It works ok if I make my own bins.



========================================

In [288]: f
Out[288]:
array([  46.,   59.,   77.,   87.,   50.,   97.,   84.,   73.,  100.,
         34.,   86.,   67.,   68.,  100.,   74.,   81.,   94.,   66.,
         52.,   66.,   69.,   54.,   85.,   97.,   31.,   49.])

In [289]: scipy.histogram(f)
---------------------------------------------------------------------------
exceptions.TypeError                                 Traceback (most 
recent call
 last)


c:\python24\Lib\site-packages\scipy\base\function_base.py in 
histogram(a, bins,
range, normed)
    116
    117     n = a.sort().searchsorted(bins)
--> 118     n = concatenate([n, [len(a)]])
    119     n = n[1:]-n[:-1]
    120

TypeError: len() of unsized object




More information about the SciPy-User mailing list