当前位置: 首页>>代码示例>>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;未经允许,请勿转载。