MCPcopy
hub / github.com/pandas-dev/pandas / _skew_kurt_wrap

Method _skew_kurt_wrap

pandas/tests/test_nanops.py:556–566  ·  view source on GitHub ↗
(self, values, axis=None, func=None)

Source from the content-addressed store, hash-verified

554 self.check_funs(nanops.nanargmin, func, skipna, allow_obj=False)
555
556 def _skew_kurt_wrap(self, values, axis=None, func=None):
557 if not isinstance(values.dtype.type, np.floating):
558 values = values.astype("f8")
559 result = func(values, axis=axis, bias=False)
560 # fix for handling cases where all elements in an axis are the same
561 if isinstance(result, np.ndarray):
562 result[np.max(values, axis=axis) == np.min(values, axis=axis)] = 0
563 return result
564 elif np.max(values) == np.min(values):
565 return 0.0
566 return result
567
568 def test_nanskew(self, skipna):
569 sp_stats = pytest.importorskip("scipy.stats")

Callers

nothing calls this directly

Calls 4

funcFunction · 0.50
astypeMethod · 0.45
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected