本文整理汇总了Python中numpy.False_方法的典型用法代码示例。如果您正苦于以下问题:Python numpy.False_方法的具体用法?Python numpy.False_怎么用?Python numpy.False_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy
的用法示例。
在下文中一共展示了numpy.False_方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bool_column
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bool_column(tmpdir):
"""
Regression test for https://github.com/astropy/astropy/issues/1953
Ensures that Table columns of bools are properly written to a FITS table.
"""
arr = np.ones(5, dtype=bool)
arr[::2] == np.False_
t = Table([arr])
t.write(str(tmpdir.join('test.fits')), overwrite=True)
with fits.open(str(tmpdir.join('test.fits'))) as hdul:
assert hdul[1].data['col0'].dtype == np.dtype('bool')
assert np.all(hdul[1].data['col0'] == arr)
示例2: test_logical
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_logical(self):
f = np.False_
t = np.True_
s = "xyz"
assert_((t and s) is s)
assert_((f and s) is f)
示例3: test_bitwise_or
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bitwise_or(self):
f = np.False_
t = np.True_
assert_((t | t) is t)
assert_((f | t) is t)
assert_((t | f) is t)
assert_((f | f) is f)
示例4: test_bitwise_and
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bitwise_and(self):
f = np.False_
t = np.True_
assert_((t & t) is t)
assert_((f & t) is f)
assert_((t & f) is f)
assert_((f & f) is f)
示例5: test_bitwise_xor
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bitwise_xor(self):
f = np.False_
t = np.True_
assert_((t ^ t) is f)
assert_((f ^ t) is t)
assert_((t ^ f) is t)
assert_((f ^ f) is f)
示例6: test_non_finite_scalar
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_non_finite_scalar(self):
# GH7014, when two scalars are compared the output should also be a
# scalar
assert_(np.isclose(np.inf, -np.inf) is np.False_)
assert_(np.isclose(0, np.inf) is np.False_)
assert_(type(np.isclose(0, np.inf)) is np.bool_)
示例7: test_logical
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_logical(self):
f = np.False_
t = np.True_
s = "xyz"
self.assertTrue((t and s) is s)
self.assertTrue((f and s) is f)
示例8: test_bitwise_or
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bitwise_or(self):
f = np.False_
t = np.True_
self.assertTrue((t | t) is t)
self.assertTrue((f | t) is t)
self.assertTrue((t | f) is t)
self.assertTrue((f | f) is f)
示例9: test_bitwise_and
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bitwise_and(self):
f = np.False_
t = np.True_
self.assertTrue((t & t) is t)
self.assertTrue((f & t) is f)
self.assertTrue((t & f) is f)
self.assertTrue((f & f) is f)
示例10: test_bitwise_xor
# 需要导入模块: import numpy [as 别名]
# 或者: from numpy import False_ [as 别名]
def test_bitwise_xor(self):
f = np.False_
t = np.True_
self.assertTrue((t ^ t) is f)
self.assertTrue((f ^ t) is t)
self.assertTrue((t ^ f) is t)
self.assertTrue((f ^ f) is f)