def test_mad_input_of_large_number(self): self.assertAlmostEqual(stats.mad(430, 2000, 1857, 587, 4118, 2530, 1185), pd.Series([430, 2000, 1857, 587, 4118, 2530, 1185]).mad())
def test_mad_input_of_neg(self): self.assertAlmostEqual(stats.mad(3, 15, 21, 13, -10), pd.Series([3, 15, 21, 13, -10]).mad(), 9)
def test_mad_input_of_rational(self): self.assertAlmostEqual(stats.mad(3.4, 15.8, 21.6, 13.2, 0.1), pd.Series([3.4, 15.8, 21.6, 13.2, 0.1]).mad())
def test_mad(self): self.assertAlmostEqual(stats.mad(3, 15, 21, 13), 5.0, 9) self.assertAlmostEqual(stats.mad(43, 20, 18, 5, 41, 25, 11), 11.183673469387754, 9)