MCPcopy Index your code
hub / github.com/numpy/numpy / test_2d

Method test_2d

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

Source from the content-addressed store, hash-verified

423 assert_array_equal(arr_view, expected)
424
425 def test_2d(self):
426 i, j = np.ogrid[:3, :4]
427 arr = 10 * i + j
428 shape = (2, 2)
429 arr_view = sliding_window_view(arr, shape)
430 expected = np.array([[[[0, 1], [10, 11]],
431 [[1, 2], [11, 12]],
432 [[2, 3], [12, 13]]],
433 [[[10, 11], [20, 21]],
434 [[11, 12], [21, 22]],
435 [[12, 13], [22, 23]]]])
436 assert_array_equal(arr_view, expected)
437
438 def test_2d_with_axis(self):
439 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