Skip to content

Loading…

mstats.kurtosistest is incorrectly converting to float, and fails to run (Trac #1769) #2288

Closed
scipy-gitbot opened this Issue · 3 comments

2 participants

@scipy-gitbot

Original ticket http://projects.scipy.org/scipy/ticket/1769 on 2012-11-05 by trac user natelust, assigned to unknown.

When using mstats.kurtosistest the following error is generated:
AttributeError: 'int' object has no attribute 'astype'
because of line 1628 n = a.count(axis=axis).astype(float)
This makes perfect sense as a would be an int, which has no astype method.
Suggest changing to:
n = np.float(a.count(axis=axis)
or the like

@scipy-gitbot

trac user natelust wrote on 2012-11-05

Silly me, I should have said this is in the mstats_basic.py file

@scipy-gitbot

@josef-pkt wrote on 2012-11-05

Yes that's a bug and the fix looks correct to me. (I'm using older numpy and scipy.)
breaks with any 1-dimensional array.

volunteers for pull requests, preferably with test case?

@rgommers
SciPy member

Fixed in gh-3008.

@rgommers rgommers closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.