def test_mean_and_std(self): obs = mean_and_std(self.x) npt.assert_almost_equal((3.5, 1.707825127), obs) obs = mean_and_std(self.x, with_std=False) self.assertEqual((3.5, None), obs) obs = mean_and_std(self.x, ddof=2) npt.assert_almost_equal((3.5, 2.091650066), obs)
def test_mean_and_std(self): obs = mean_and_std(self.x) npt.assert_almost_equal((3.5, 1.707825127), obs) obs = mean_and_std(self.x, with_std=False) self.assertEqual((3.5, None), obs) obs = mean_and_std(self.x, ddof=2) npt.assert_almost_equal((3.5, 2.091650066), obs)
def test_mean_and_std_no_mean_no_std(self): with npt.assert_raises(ValueError): mean_and_std(self.x, with_mean=False, with_std=False)
def test_mean_and_std_no_mean_no_std(self): with npt.assert_raises(ValueError): mean_and_std(self.x, with_mean=False, with_std=False)