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

Method test_zscore

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

Source from the content-addressed store, hash-verified

3176 NormalDist(1, 0).overlap(X) # left operand sigma is zero
3177
3178 def test_zscore(self):
3179 NormalDist = self.module.NormalDist
3180 X = NormalDist(100, 15)
3181 self.assertEqual(X.zscore(142), 2.8)
3182 self.assertEqual(X.zscore(58), -2.8)
3183 self.assertEqual(X.zscore(100), 0.0)
3184 with self.assertRaises(TypeError):
3185 X.zscore() # too few arguments
3186 with self.assertRaises(TypeError):
3187 X.zscore(1, 1) # too may arguments
3188 with self.assertRaises(TypeError):
3189 X.zscore(None) # non-numeric type
3190 with self.assertRaises(self.module.StatisticsError):
3191 NormalDist(1, 0).zscore(100) # sigma is zero
3192
3193 def test_properties(self):
3194 X = self.module.NormalDist(100, 15)

Callers

nothing calls this directly

Calls 4

zscoreMethod · 0.95
NormalDistClass · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected