python div_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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值