コード例 #1
0
ファイル: test_shape_base.py プロジェクト: xiaoc10/numpy
 def test_2D_array(self):
     a = np.array([[1], [2]])
     b = np.array([[1], [2]])
     res = dstack([a, b])
     desired = np.array([[[1, 1]], [[
         2,
         2,
     ]]])
     assert_array_equal(res, desired)
コード例 #2
0
 def test_generator(self):
     with assert_warns(FutureWarning):
         dstack((np.arange(3) for _ in range(2)))
コード例 #3
0
 def test_1D_array(self):
     a = np.array([1])
     b = np.array([2])
     res = dstack([a, b])
     desired = np.array([[[1, 2]]])
     assert_array_equal(res, desired)
コード例 #4
0
ファイル: test_shape_base.py プロジェクト: ContinuumIO/numpy
 def test_2D_array2(self):
     a = np.array([1, 2])
     b = np.array([1, 2])
     res = dstack([a, b])
     desired = np.array([[[1, 1], [2, 2]]])
     assert_array_equal(res, desired)
コード例 #5
0
ファイル: test_shape_base.py プロジェクト: ContinuumIO/numpy
 def test_0D_array(self):
     a = np.array(1)
     b = np.array(2)
     res = dstack([a, b])
     desired = np.array([[[1, 2]]])
     assert_array_equal(res, desired)
コード例 #6
0
ファイル: test_shape_base.py プロジェクト: Horta/numpy
 def test_generator(self):
     with assert_warns(FutureWarning):
         dstack((np.arange(3) for _ in range(2)))
コード例 #7
0
ファイル: ex3_2.py プロジェクト: yk/patternhs12
def getBlackWhiteFromBinary(img):
    return dstack((img,img,img))