MCPcopy Index your code
hub / github.com/dask/dask / skew

Function skew

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

Source from the content-addressed store, hash-verified

237
238@derived_from(scipy.stats)
239def skew(a, axis=0, bias=True, nan_policy="propagate"):
240 if nan_policy != "propagate":
241 raise NotImplementedError(
242 "`nan_policy` other than 'propagate' have not been implemented."
243 )
244
245 n = a.shape[axis] # noqa: F841 # for bias
246 m2 = moment(a, 2, axis)
247 m3 = moment(a, 3, axis)
248 zero = m2 == 0
249 vals = da.where(~zero, m3 / m2**1.5, 0.0)
250 # vals = da.where(~zero, (m2, m3),
251 # lambda m2, m3: m3 / m2**1.5,
252 # 0.)
253 if not bias:
254 # Need a version of np.place
255 raise NotImplementedError("bias=False is not implemented.")
256
257 if vals.ndim == 0:
258 # TODO: scalar, min is a workaround
259 return vals.min()
260
261 return vals
262
263
264@derived_from(scipy.stats)

Callers 1

skewtestFunction · 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…