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

Function test_replace_mixed_object

pandas/tests/strings/test_find_replace.py:611–619  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

609
610
611def test_replace_mixed_object():
612 ser = Series(
613 ["aBAD", np.nan, "bBAD", True, datetime.today(), "fooBAD", None, 1, 2.0]
614 )
615 result = Series(ser).str.replace("BAD[_]*", "", regex=True)
616 expected = Series(
617 ["a", np.nan, "b", np.nan, np.nan, "foo", None, np.nan, np.nan], dtype=object
618 )
619 tm.assert_series_equal(result, expected)
620
621
622def test_replace_unicode(any_string_dtype):

Callers

nothing calls this directly

Calls 2

SeriesClass · 0.90
replaceMethod · 0.45

Tested by

no test coverage detected