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

Method test_empty_view

numpy/core/tests/test_multiarray.py:5900–5906  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5898 assert_array_equal(a['k'][:-5], 1)
5899
5900 def test_empty_view(self):
5901 # check that sizes containing a zero don't trigger a reallocate for
5902 # already empty arrays
5903 x = np.zeros((10, 0), int)
5904 x_view = x[...]
5905 x_view.resize((0, 10))
5906 x_view.resize((0, 100))
5907
5908 def test_check_weakref(self):
5909 x = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected