MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_quantiles

Method test_quantiles

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

quantilesMethod · 0.95
allFunction · 0.85
assertTrueMethod · 0.80

Tested by

no test coverage detected