我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用numpy.polydiv()。
def test_poly_div(self, level=rlevel): # Ticket #553 u = np.poly1d([1, 2, 3]) v = np.poly1d([1, 2, 3, 4, 5]) q, r = np.polydiv(u, v) assert_equal(q*v + r, u)
def test_polydiv_type(self): # Make polydiv work for complex types msg = "Wrong type, should be complex" x = np.ones(3, dtype=np.complex) q, r = np.polydiv(x, x) assert_(q.dtype == np.complex, msg) msg = "Wrong type, should be float" x = np.ones(3, dtype=np.int) q, r = np.polydiv(x, x) assert_(q.dtype == np.float, msg)