Ejemplo n.º 1
0
 def test_sum_by_n(self):
     d = np.array([10, 9, 20, 30])
     w = np.array([0.5, 0.1, 0.3, 0.8])
     n = 2
     exp_sum = np.array([5.9, 30.0])
     np.testing.assert_array_almost_equal(exp_sum, sm.sum_by_n(d, w, n))
Ejemplo n.º 2
0
 def test_sum_by_n(self):
     d = np.array([10, 9, 20, 30])
     w = np.array([0.5, 0.1, 0.3, 0.8])
     n = 2
     exp_sum = np.array([5.9, 30.])
     np.testing.assert_array_almost_equal(exp_sum, sm.sum_by_n(d, w, n))