示例#1
0
    def test_asfarray(self):
        a = asfarray(np.array([1, 2, 3]))
        assert_equal(a.__class__, np.ndarray)
        assert_(np.issubdtype(a.dtype, np.floating))

        # previously this would infer dtypes from arrays, unlike every single
        # other numpy function
        assert_raises(TypeError, asfarray, np.array([1, 2, 3]), dtype=np.array(1.0))
示例#2
0
    def test_asfarray(self):
        a = asfarray(np.array([1, 2, 3]))
        assert_equal(a.__class__, np.ndarray)
        assert_(np.issubdtype(a.dtype, np.floating))

        # previously this would infer dtypes from arrays, unlike every single
        # other numpy function
        assert_raises(TypeError,
            asfarray, np.array([1, 2, 3]), dtype=np.array(1.0))
示例#3
0
 def test_asfarray(self):
     a = asfarray(np.array([1, 2, 3]))
     assert_equal(a.__class__, np.ndarray)
     assert_(np.issubdtype(a.dtype, np.float))
示例#4
0
 def test_asfarray(self):
     a = asfarray(np.array([1, 2, 3]))
     assert_equal(a.__class__, np.ndarray)
     assert_(np.issubdtype(a.dtype, np.float))