当前位置: 首页>>代码示例>>Python>>正文


Python core.float64方法代码示例

本文整理汇总了Python中numpy.core.float64方法的典型用法代码示例。如果您正苦于以下问题:Python core.float64方法的具体用法?Python core.float64怎么用?Python core.float64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在numpy.core的用法示例。


在下文中一共展示了core.float64方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: rand

# 需要导入模块: from numpy import core [as 别名]
# 或者: from numpy.core import float64 [as 别名]
def rand(*args):
    """Returns an array of random numbers with the given shape.

    This only uses the standard library, so it is useful for testing purposes.
    """
    import random
    from numpy.core import zeros, float64
    results = zeros(args, float64)
    f = results.flat
    for i in range(len(f)):
        f[i] = random.random()
    return results 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:utils.py

示例2: integer_repr

# 需要导入模块: from numpy import core [as 别名]
# 或者: from numpy.core import float64 [as 别名]
def integer_repr(x):
    """Return the signed-magnitude interpretation of the binary representation of
    x."""
    import numpy as np
    if x.dtype == np.float16:
        return _integer_repr(x, np.int16, np.int16(-2**15))
    elif x.dtype == np.float32:
        return _integer_repr(x, np.int32, np.int32(-2**31))
    elif x.dtype == np.float64:
        return _integer_repr(x, np.int64, np.int64(-2**63))
    else:
        raise ValueError("Unsupported dtype %s" % x.dtype) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:utils.py

示例3: integer_repr

# 需要导入模块: from numpy import core [as 别名]
# 或者: from numpy.core import float64 [as 别名]
def integer_repr(x):
    """Return the signed-magnitude interpretation of the binary representation of
    x."""
    import numpy as np
    if x.dtype == np.float32:
        return _integer_repr(x, np.int32, np.int32(-2**31))
    elif x.dtype == np.float64:
        return _integer_repr(x, np.int64, np.int64(-2**63))
    else:
        raise ValueError("Unsupported dtype %s" % x.dtype)

# The following two classes are copied from python 2.6 warnings module (context
# manager) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:15,代码来源:utils.py

示例4: integer_repr

# 需要导入模块: from numpy import core [as 别名]
# 或者: from numpy.core import float64 [as 别名]
def integer_repr(x):
    """Return the signed-magnitude interpretation of the binary representation of
    x."""
    import numpy as np
    if x.dtype == np.float32:
        return _integer_repr(x, np.int32, np.int32(-2**31))
    elif x.dtype == np.float64:
        return _integer_repr(x, np.int64, np.int64(-2**63))
    else:
        raise ValueError("Unsupported dtype %s" % x.dtype)


# The following two classes are copied from python 2.6 warnings module (context
# manager) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:16,代码来源:utils.py

示例5: test_vecself

# 需要导入模块: from numpy import core [as 别名]
# 或者: from numpy.core import float64 [as 别名]
def test_vecself(self):
        """Ticket 844."""
        # Inner product of a vector with itself segfaults or give meaningless
        # result
        a = zeros(shape = (1, 80), dtype = float64)
        p = inner_(a, a)
        assert_almost_equal(p, 0, decimal = DECPREC) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:9,代码来源:test_blasdot.py


注:本文中的numpy.core.float64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。