def test_empty(self): sr = pd.Series(dtype='float64') exp = 0 self.assertEqual(exp, entropy_series(sr))
def test4(self): sr = pd.Series([5, 9]) exp = 0.9402859 np.testing.assert_almost_equal(exp, entropy_series(sr))
def test5(self): sr = pd.Series([5, 5]) exp = 1 np.testing.assert_almost_equal(exp, entropy_series(sr))
def test3(self): sr = pd.Series([10, 0]) exp = 0 np.testing.assert_almost_equal(exp, entropy_series(sr))