MCPcopy
hub / github.com/pandas-dev/pandas / test_replace

Function test_replace

pandas/tests/strings/test_find_replace.py:591–596  ·  view source on GitHub ↗
(any_string_dtype)

Source from the content-addressed store, hash-verified

589
590
591def test_replace(any_string_dtype):
592 ser = Series(["fooBAD__barBAD", np.nan], dtype=any_string_dtype)
593
594 result = ser.str.replace("BAD[_]*", "", regex=True)
595 expected = Series(["foobar", np.nan], dtype=any_string_dtype)
596 tm.assert_series_equal(result, expected)
597
598
599def test_replace_max_replacements(any_string_dtype):

Callers

nothing calls this directly

Calls 2

SeriesClass · 0.90
replaceMethod · 0.45

Tested by

no test coverage detected