def test_std_dev_with_mean(self):
        # Arrange
        values = [0.0, 1.1, 2.2, 3.3, 4.4, 8.1, 9.9, -3.0]
        mean = fast_mean(values)

        # Act
        result1 = fast_std(values)
        result2 = fast_std_with_mean(values, mean)

        # Assert
        self.assertEqual(np.std(values), result1)
        self.assertEqual(np.std(values), result2)
        self.assertAlmostEqual(3.943665807342199, result1)
        self.assertAlmostEqual(3.943665807342199, result2)
Beispiel #2
0
    def test_std_dev_with_mean(self):
        # Arrange
        values = [0.0, 1.1, 2.2, 3.3, 4.4, 8.1, 9.9, -3.0]
        mean = fast_mean(values)

        # Act
        result1 = fast_std(values)
        result2 = fast_std_with_mean(values, mean)

        # Assert
        assert np.std(values) == result1
        assert np.std(values) == result2
        assert 3.943665807342199 == result1
        assert 3.943665807342199 == result2
Beispiel #3
0
    def test_std_dev_with_mean(self):
        # Arrange
        values = np.asarray([0.0, 1.1, 2.2, 3.3, 4.4, 8.1, 9.9, -3.0],
                            dtype=np.float64)
        mean = fast_mean(values)

        # Act
        result1 = fast_std(values)
        result2 = fast_std_with_mean(values, mean)

        # Assert
        assert result1 == np.std(values)
        assert result2 == np.std(values)
        assert result1 == 3.943665807342199
        assert result2 == 3.943665807342199
Beispiel #4
0
 def fast_std(self):
     fast_std(self.values)