Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added RuntimeWarning suppression in scipy.stats.kurtosis for one-dime…

…nsional

input having a second moment equal to zero (i.e. m2==0).
  • Loading branch information...
commit bf788cf388d7dd8a62c1b0868a0b7b71f8cdb49e 1 parent 0f859ee
@trueprice authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 scipy/stats/stats.py
View
7 scipy/stats/stats.py
@@ -1075,7 +1075,12 @@ def kurtosis(a, axis=0, fisher=True, bias=True):
m2 = moment(a,2,axis)
m4 = moment(a,4,axis)
zero = (m2 == 0)
- vals = np.where(zero, 0, m4/ m2**2.0)
+ olderr = np.seterr(all='ignore')
+ try:
+ vals = np.where(zero, 0, m4/ m2**2.0)
+ finally:
+ np.seterr(**olderr)
+
if not bias:
can_correct = (n > 3) & (m2 > 0)
if can_correct.any():
Please sign in to comment.
Something went wrong with that request. Please try again.