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

Method test_empty

numpy/_core/tests/test_item_selection.py:124–131  ·  view source on GitHub ↗
(self, dtype, mode)

Source from the content-addressed store, hash-verified

122 @pytest.mark.parametrize("dtype", list(np.typecodes["All"])[1:] + ["i,O"])
123 @pytest.mark.parametrize("mode", ["raise", "wrap", "clip"])
124 def test_empty(self, dtype, mode):
125 arr = np.zeros(1000, dtype=dtype)
126 arr_copy = arr.copy()
127 mask = np.random.randint(2, size=1000).astype(bool)
128
129 # Allowing empty values like this is weird...
130 np.put(arr, mask, [])
131 assert_array_equal(arr, arr_copy)
132
133
134class TestPut:

Callers

nothing calls this directly

Calls 4

assert_array_equalFunction · 0.90
astypeMethod · 0.80
putMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected