fmod函数python_python fmod函数_Python numpy.fmod方法代码示例

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

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

示例1: test_NotImplemented_not_returned

点赞 6

# 需要导入模块: import numpy [as 别名]

# 或者: from numpy import fmod [as 别名]

def test_NotImplemented_not_returned(self):

# See gh-5964 and gh-2091. Some of these functions are not operator

# related and were fixed for other reasons in the past.

binary_funcs = [

np.power, np.add, np.subtract, np.multiply, np.divide,

np.true_divide, np.floor_divide, np.bitwise_and, np.bitwise_or,

np.bitwise_xor, np.left_shift, np.right_shift, np.fmax,

np.fmin, np.fmod, np.hypot, np.logaddexp, np.logaddexp2,

np.logical_and, np.logical_or, np.logical_xor, np.maximum,

np.minimum, np.mod,

np.greater, np.greater_equal, np.less, np.less_equal,

np.equal, np.not_equal]

a = np.array('1')

b = 1

c = np.array([1., 2.])

for f in binary_funcs:

assert_raises(TypeError, f, a, b)

assert_raises(TypeError, f, c, a)

开发者ID:Frank-qlu,项目名称:recruit,代码行数:21,

示例2: test_NotImplemented_not_returned

点赞 6

# 需要导入模块: import numpy [as 别名]

# 或者: from numpy import fmod [as 别名]

def test_NotImplemented_not_returned(self):

# See gh-5964 and gh-2091. Some of these functions are not operator

# related and were fixed for other reasons in the past.

binary_funcs = [

np.power, np.add, np.subtract, np.multiply, np.divide,

np.true_divide, np.floor_divide, np.bitwise_and, np.bitwise_or,

np.bitwise_xor, np.left_shift, np.right_shift, np.fmax,

np.fmin, np.fmod, np.hypot, np.logaddexp, np.logaddexp2,

np.logical_and, np.logical_or, np.logical_xor, np.maximum,

np.minimum, np.mod

]

# These functions still return NotImplemented. Will be fixed in

# future.

# bad = [np.greater, np.greater_equal, np.less, np.less_equal, np.not_equal]

a = np.array('1')

b = 1

for f in binary_funcs:

assert_raises(TypeError, f, a, b)

开发者ID:abhis

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值