[Scipy-tickets] [SciPy] #1661: scipy.stats.mstats.kurtosistest crashes on 1d input

SciPy Trac scipy-tickets@scipy....
Mon May 21 14:34:43 CDT 2012

#1661: scipy.stats.mstats.kurtosistest crashes on 1d input
 Reporter:  dougal       |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.10.0     
 Keywords:               |  
 For example,

 >>> stats.mstats.kurtosistest(np.random.normal(size=(100,)))
 Traceback (most recent call last):
   File "<ipython-input-11-570df841a764>", line 1, in <module>
   File "/Library/Python/2.7/site-
 line 1628, in kurtosistest
     n = a.count(axis=axis).astype(float)
 AttributeError: 'int' object has no attribute 'astype'

 This is because ma.count sometimes returns an integer. One possible fix
 would be to change that line to:

     n = np.asanyarray(a.count(axis=axis), dtype=float)

Ticket URL: <http://projects.scipy.org/scipy/ticket/1661>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list