コード例 #1
0
ファイル: test_extras.py プロジェクト: phonx/FlipbookApp
 def test_basic(self):
     a = arange(24).reshape(2, 3, 4)
     test = apply_over_axes(np.sum, a, [0, 2])
     ctrl = np.array([[[60], [92], [124]]])
     assert_equal(test, ctrl)
     a[(a % 2).astype(np.bool)] = masked
     test = apply_over_axes(np.sum, a, [0, 2])
     ctrl = np.array([[[30], [44], [60]]])
コード例 #2
0
ファイル: test_extras.py プロジェクト: Alanchi/numpy
 def test_basic(self):
     a = arange(24).reshape(2, 3, 4)
     test = apply_over_axes(np.sum, a, [0, 2])
     ctrl = np.array([[[60], [92], [124]]])
     assert_equal(test, ctrl)
     a[(a % 2).astype(np.bool)] = masked
     test = apply_over_axes(np.sum, a, [0, 2])
     ctrl = np.array([[[30], [44], [60]]])