def test_variance(self): # Returns 2.5. v = metrics.variance([1,2,3,4,5], sample=True) self.assertEqual(v, 2.5) # Returns 2.0 (population variance). v = metrics.variance([1,2,3,4,5], sample=False) self.assertEqual(v, 2.0)
def test_variance(self): # Assert 2.5. v = metrics.variance([1,2,3,4,5], sample=True) self.assertEqual(v, 2.5) # Assert 2.0 (population variance). v = metrics.variance([1,2,3,4,5], sample=False) self.assertEqual(v, 2.0) print("pattern.metrics.variance()")
def test_variance(self): # Assert 2.5. v = metrics.variance([1, 2, 3, 4, 5], sample=True) self.assertEqual(v, 2.5) # Assert 2.0 (population variance). v = metrics.variance([1, 2, 3, 4, 5], sample=False) self.assertEqual(v, 2.0) print("pattern.metrics.variance()")