當前位置: 首頁>>代碼示例>>Python>>正文


Python numerictypes.sctypes方法代碼示例

本文整理匯總了Python中numpy.core.numerictypes.sctypes方法的典型用法代碼示例。如果您正苦於以下問題:Python numerictypes.sctypes方法的具體用法?Python numerictypes.sctypes怎麽用?Python numerictypes.sctypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.core.numerictypes的用法示例。


在下文中一共展示了numerictypes.sctypes方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_floats

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_floats(self):
        for t in sctypes['float']:
            assert_(isinstance(t(), numbers.Real),
                    "{0} is not instance of Real".format(t.__name__))
            assert_(issubclass(t, numbers.Real),
                    "{0} is not subclass of Real".format(t.__name__))
            assert_(not isinstance(t(), numbers.Rational),
                    "{0} is instance of Rational".format(t.__name__))
            assert_(not issubclass(t, numbers.Rational),
                    "{0} is subclass of Rational".format(t.__name__)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:12,代碼來源:test_abc.py

示例2: test_complex

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_complex(self):
        for t in sctypes['complex']:
            assert_(isinstance(t(), numbers.Complex),
                    "{0} is not instance of Complex".format(t.__name__))
            assert_(issubclass(t, numbers.Complex),
                    "{0} is not subclass of Complex".format(t.__name__))
            assert_(not isinstance(t(), numbers.Real),
                    "{0} is instance of Real".format(t.__name__))
            assert_(not issubclass(t, numbers.Real),
                    "{0} is subclass of Real".format(t.__name__)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:12,代碼來源:test_abc.py

示例3: test_int

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_int(self):
        for t in sctypes['int']:
            assert_(isinstance(t(), numbers.Integral),
                    "{0} is not instance of Integral".format(t.__name__))
            assert_(issubclass(t, numbers.Integral),
                    "{0} is not subclass of Integral".format(t.__name__)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:8,代碼來源:test_abc.py

示例4: test_uint

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_uint(self):
        for t in sctypes['uint']:
            assert_(isinstance(t(), numbers.Integral),
                    "{0} is not instance of Integral".format(t.__name__))
            assert_(issubclass(t, numbers.Integral),
                    "{0} is not subclass of Integral".format(t.__name__)) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:8,代碼來源:test_abc.py

示例5: test_floats

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_floats(self):
        for t in sctypes['float']:
            assert_(isinstance(t(), numbers.Real), 
                    "{0} is not instance of Real".format(t.__name__))
            assert_(issubclass(t, numbers.Real),
                    "{0} is not subclass of Real".format(t.__name__))
            assert_(not isinstance(t(), numbers.Rational), 
                    "{0} is instance of Rational".format(t.__name__))
            assert_(not issubclass(t, numbers.Rational),
                    "{0} is subclass of Rational".format(t.__name__)) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:12,代碼來源:test_abc.py

示例6: test_complex

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_complex(self):
        for t in sctypes['complex']:
            assert_(isinstance(t(), numbers.Complex), 
                    "{0} is not instance of Complex".format(t.__name__))
            assert_(issubclass(t, numbers.Complex),
                    "{0} is not subclass of Complex".format(t.__name__))
            assert_(not isinstance(t(), numbers.Real), 
                    "{0} is instance of Real".format(t.__name__))
            assert_(not issubclass(t, numbers.Real),
                    "{0} is subclass of Real".format(t.__name__)) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:12,代碼來源:test_abc.py

示例7: test_int

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_int(self):
        for t in sctypes['int']:
            assert_(isinstance(t(), numbers.Integral), 
                    "{0} is not instance of Integral".format(t.__name__))
            assert_(issubclass(t, numbers.Integral),
                    "{0} is not subclass of Integral".format(t.__name__)) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:8,代碼來源:test_abc.py

示例8: test_uint

# 需要導入模塊: from numpy.core import numerictypes [as 別名]
# 或者: from numpy.core.numerictypes import sctypes [as 別名]
def test_uint(self):
        for t in sctypes['uint']:
            assert_(isinstance(t(), numbers.Integral), 
                    "{0} is not instance of Integral".format(t.__name__))
            assert_(issubclass(t, numbers.Integral),
                    "{0} is not subclass of Integral".format(t.__name__)) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:8,代碼來源:test_abc.py


注:本文中的numpy.core.numerictypes.sctypes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。