MCPcopy
hub / github.com/dask/dask / kurtosis

Function kurtosis

dask/array/stats.py:295–321  ·  view source on GitHub ↗
(a, axis=0, fisher=True, bias=True, nan_policy="propagate")

Source from the content-addressed store, hash-verified

293
294@derived_from(scipy.stats)
295def kurtosis(a, axis=0, fisher=True, bias=True, nan_policy="propagate"):
296 if nan_policy != "propagate":
297 raise NotImplementedError(
298 "`nan_policy` other than 'propagate' have not been implemented."
299 )
300 n = a.shape[axis] # noqa: F841 # for bias
301 m2 = moment(a, 2, axis)
302 m4 = moment(a, 4, axis)
303 zero = m2 == 0
304 olderr = np.seterr(all="ignore")
305 try:
306 vals = da.where(zero, 0, m4 / m2**2.0)
307 finally:
308 np.seterr(**olderr)
309
310 if not bias:
311 # need a version of np.place
312 raise NotImplementedError("bias=False is not implemented.")
313
314 if fisher:
315 return vals - 3
316 else:
317 if vals.ndim == 0:
318 # TODO: scalar, min is a workaround
319 return vals.min()
320
321 return vals
322
323
324@derived_from(scipy.stats)

Callers 1

kurtosistestFunction · 0.85

Calls 3

momentFunction · 0.70
whereMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…