Original ticket http://projects.scipy.org/scipy/ticket/1661 on 2012-05-21 by @dougalsutherland, assigned to unknown.
Traceback (most recent call last):
File "<ipython-input-11-570df841a764>", line 1, in <module>
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)
trac user bdieseldorff wrote on 2012-07-26
After the fix suggested by dougal, the line that reads
denom[denom < 0] = masked
also needs to be changed. In particular, it should be skipped entirely if you have a single float value instead of an array (or maybe give a warning if the only value would get masked?).
Fixed by gh-3008.