本文整理匯總了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)