def test_trimcoef(self): coef = [2, -1, 1, 0] # Test exceptions assert_raises(ValueError, pu.trimcoef, coef, -1) # Test results assert_equal(pu.trimcoef(coef), coef[:-1]) assert_equal(pu.trimcoef(coef, 1), coef[:-3]) assert_equal(pu.trimcoef(coef, 2), [0])
def test_trimcoef(self) : coef = [2, -1, 1, 0] # Test exceptions assert_raises(ValueError, pu.trimcoef, coef, -1) # Test results assert_equal(pu.trimcoef(coef), coef[:-1]) assert_equal(pu.trimcoef(coef, 1), coef[:-3]) assert_equal(pu.trimcoef(coef, 2), [0])
def trimcoef(c, tol=0): from numpy.polynomial.polyutils import trimcoef return trimcoef(c, tol)
def trimcoef(c, tol=0) : from numpy.polynomial.polyutils import trimcoef return trimcoef(c, tol)