[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>
     stats.mstats.kurtosistest(np.random.normal(size=(100,)))
   File "/Library/Python/2.7/site-
 packages/scipy-0.10.1-py2.7-macosx-10.7-x86_64.egg/scipy/stats/mstats_basic.py",
 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