Exemplo n.º 1
0
 def test_random_list(self):
     self.assertAlmostEqual(
         get_column_stats.calculate_mean(self.testcase4),
         np.mean(self.testcase4), 5)
     self.assertAlmostEqual(
         get_column_stats.calculate_stdev(self.testcase4),
         np.std(self.testcase4), 5)
 def test_random_values(self):
     for i in range(100):
         length = random.randint(1, 1000)
         rand = []
         for j in range(length):
             rand.append(random.randint(1, 1000))
         self.assertAlmostEqual(get_column_stats.calculate_stdev(rand),
                                np.std(rand))
Exemplo n.º 3
0
 def test_testcase3(self):
     self.assertEqual(
         get_column_stats.calculate_mean(self.testcase3), 3.5)
     self.assertAlmostEqual(
         get_column_stats.calculate_stdev(self.testcase3), 1.707825128, 5)
Exemplo n.º 4
0
 def test_testcase2(self):
     self.assertEqual(
         get_column_stats.calculate_mean(self.testcase2), 2)
     self.assertAlmostEqual(
         get_column_stats.calculate_stdev(self.testcase2), 0.816496581, 5)
 def test_fixed_value(self):
     self.assertEqual(get_column_stats.calculate_stdev([1, 1, 1, 1, 1]), 0)