Skip to content

Commit 1e21e21

Browse files
committed
test(skew): add low variance test
1 parent 59ffa92 commit 1e21e21

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/test_nanops.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,13 @@ def test_nans_skipna(self, samples, actual_skew):
10511051
skew = nanops.nanskew(samples, skipna=True)
10521052
tm.assert_almost_equal(skew, actual_skew)
10531053

1054+
def test_low_variance(self):
1055+
data_list = [-2.05191341e-06, -4.10391103e-07] + ([0.0] * 27)
1056+
data = np.array(data_list)
1057+
kurt = nanops.nanskew(data)
1058+
expected = -5.092092799675377 # scipy.stats.skew(data, bias=False)
1059+
tm.assert_almost_equal(kurt, expected)
1060+
10541061
@property
10551062
def prng(self):
10561063
return np.random.default_rng(2)

0 commit comments

Comments
 (0)