MCPcopy Create free account
hub / github.com/numpy/numpy / test_2d

Method test_2d

numpy/lib/tests/test_stride_tricks.py:410–421  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

408 assert_array_equal(arr_view, expected)
409
410 def test_2d(self):
411 i, j = np.ogrid[:3, :4]
412 arr = 10*i + j
413 shape = (2, 2)
414 arr_view = sliding_window_view(arr, shape)
415 expected = np.array([[[[0, 1], [10, 11]],
416 [[1, 2], [11, 12]],
417 [[2, 3], [12, 13]]],
418 [[[10, 11], [20, 21]],
419 [[11, 12], [21, 22]],
420 [[12, 13], [22, 23]]]])
421 assert_array_equal(arr_view, expected)
422
423 def test_2d_with_axis(self):
424 i, j = np.ogrid[:3, :4]

Callers

nothing calls this directly

Calls 2

sliding_window_viewFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected