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

Method test_replace_regression

numpy/_core/tests/test_regression.py:2606–2615  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2604 np.isclose(np.int64(2), np.int64(2), atol=1e-15, rtol=1e-300)
2605
2606 def test_replace_regression(self):
2607 # gh-25513 segfault
2608 carr = np.char.chararray((2,), itemsize=25)
2609 test_strings = [b' 4.52173913043478315E+00',
2610 b' 4.95652173913043548E+00']
2611 carr[:] = test_strings
2612 out = carr.replace(b"E", b"D")
2613 expected = np.char.chararray((2,), itemsize=25)
2614 expected[:] = [s.replace(b"E", b"D") for s in test_strings]
2615 assert_array_equal(out, expected)
2616
2617 def test_logspace_base_does_not_determine_dtype(self):
2618 # gh-24957 and cupy/cupy/issues/7946

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected