當前位置: 首頁>>代碼示例>>Python>>正文


Python polynomial.Polynomial方法代碼示例

本文整理匯總了Python中numpy.polynomial.Polynomial方法的典型用法代碼示例。如果您正苦於以下問題:Python polynomial.Polynomial方法的具體用法?Python polynomial.Polynomial怎麽用?Python polynomial.Polynomial使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.polynomial的用法示例。


在下文中一共展示了polynomial.Polynomial方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_polynomial_str

# 需要導入模塊: from numpy import polynomial [as 別名]
# 或者: from numpy.polynomial import Polynomial [as 別名]
def test_polynomial_str(self):
        res = str(poly.Polynomial([0, 1]))
        tgt = 'poly([0. 1.])'
        assert_equal(res, tgt) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:6,代碼來源:test_printing.py

示例2: _from_list_

# 需要導入模塊: from numpy import polynomial [as 別名]
# 或者: from numpy.polynomial import Polynomial [as 別名]
def _from_list_(self, l, k):
        if l[0] == 'PART_TFIELD':
            self.data[k] = _ip.interp1d(l[1][0].grids[0], l[1][0].data)
        elif l[0] == 'PART_COEFF':
            self.data[k] = _P(l[1][0].data)
        else:
            raise RuntimeError("Unknown or not implemented " +
                               "partition_functions type encountered") 
開發者ID:atmtools,項目名稱:typhon,代碼行數:10,代碼來源:internals.py

示例3: __setitem__

# 需要導入模塊: from numpy import polynomial [as 別名]
# 或者: from numpy.polynomial import Polynomial [as 別名]
def __setitem__(self, key, data):
        if type(data) is list:
            self._from_list_(data, key)
        elif type(data) in [_P, _ip.interp1d]:
            self.data[key] = data
        else:
            try:
                data(self._default_test)
                self.data[key] = data
            except:
                raise RuntimeError("Cannot determine type") 
開發者ID:atmtools,項目名稱:typhon,代碼行數:13,代碼來源:internals.py

示例4: test_polynomial_str

# 需要導入模塊: from numpy import polynomial [as 別名]
# 或者: from numpy.polynomial import Polynomial [as 別名]
def test_polynomial_str(self):
        res = str(poly.Polynomial([0, 1]))
        tgt = 'poly([0., 1.])'
        assert_(res, tgt) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:6,代碼來源:test_printing.py

示例5: invertibleroots

# 需要導入模塊: from numpy import polynomial [as 別名]
# 或者: from numpy.polynomial import Polynomial [as 別名]
def invertibleroots(ma):
    import numpy.polynomial as poly
    pr = poly.polyroots(ma)
    insideroots = np.abs(pr)<1
    if insideroots.any():
        pr[np.abs(pr)<1] = 1./pr[np.abs(pr)<1]
        pnew = poly.Polynomial.fromroots(pr)
        mainv = pn.coef/pnew.coef[0]
        wasinvertible = False
    else:
        mainv = ma
        wasinvertible = True
    return mainv, wasinvertible 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:15,代碼來源:try_mlecov.py

示例6: getpoly

# 需要導入模塊: from numpy import polynomial [as 別名]
# 或者: from numpy.polynomial import Polynomial [as 別名]
def getpoly(self, params):
    ar = np.r_[[1], -params[:self.nar]]
    ma = np.r_[[1], params[-self.nma:]]
    import numpy.polynomial as poly
    return poly.Polynomial(ar), poly.Polynomial(ma) 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:7,代碼來源:try_mlecov.py


注:本文中的numpy.polynomial.Polynomial方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。