Python numpy.polydiv() 使用实例

The following are code examples for showing how to use . They are extracted from open source Python projects. You can vote up the examples you like or vote down the exmaples you don’t like. You can also save this page to your account.

Example 1

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) 

Example 2

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) 

Example 3

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) 

Example 4

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) 

Example 5

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) 

Example 6

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) 

Example 7

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) 

Example 8

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) 

Example 9

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) 

Example 10

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) 

Example 11

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) 

Example 12

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) 
点赞