MCPcopy Index your code
hub / github.com/python/cpython / test_quantiles

Method test_quantiles

Lib/test/test_statistics.py:3100–3111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3098 self.assertTrue(math.isnan(Z.inv_cdf(float('NaN'))))
3099
3100 def test_quantiles(self):
3101 # Quartiles of a standard normal distribution
3102 Z = self.module.NormalDist()
3103 for n, expected in [
3104 (1, []),
3105 (2, [0.0]),
3106 (3, [-0.4307, 0.4307]),
3107 (4 ,[-0.6745, 0.0, 0.6745]),
3108 ]:
3109 actual = Z.quantiles(n=n)
3110 self.assertTrue(all(math.isclose(e, a, abs_tol=0.0001)
3111 for e, a in zip(expected, actual)))
3112
3113 def test_overlap(self):
3114 NormalDist = self.module.NormalDist

Callers

nothing calls this directly

Calls 2

quantilesMethod · 0.95
assertTrueMethod · 0.80

Tested by

no test coverage detected