Skip to content

Commit 41a2bf4

Browse files
pep8 error
1 parent 7929610 commit 41a2bf4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pandas/core/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def str_replace(arr, pat, repl, n=-1, case=None, flags=0, regex=None):
583583
"regex=False")
584584
# if regex is default None, and a single special character is given
585585
# in pat, still take it as a literal, and raise the Future warning
586-
if regex is None and len(pat) == 1 and pat in list("[\^$.|?*+()]"):
586+
if regex is None and len(pat) == 1 and pat in list(r"[\^$.|?*+()]"):
587587
warnings.warn("'{}' is interpreted as a literal in ".format(pat) +
588588
"default, not regex. It will change in the future.",
589589
FutureWarning)

pandas/tests/test_strings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3441,8 +3441,9 @@ def test_replace_single_pattern(self, regex, expected_array):
34413441
expected = Series(expected_array)
34423442
tm.assert_series_equal(result, expected)
34433443

3444-
@pytest.mark.parametrize("input_array, single_char, replace_char,"
3445-
"expect_array, warn", [
3444+
@pytest.mark.parametrize("input_array, single_char, replace_char, "
3445+
"expect_array, warn",
3446+
[
34463447
("a.c", ".", "b", "abc", True),
34473448
("a@c", "@", "at", "aatc", False)
34483449
])

0 commit comments

Comments
 (0)