Skip to content

Commit 30d4727

Browse files
author
Joost Kranendonk
authored
Bug fix in .str.replace type checking done wrong
Dull mistake
1 parent 4baa0a7 commit 30d4727

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/strings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def str_replace(arr, pat, repl, n=-1, case=True, flags=0):
319319
"""
320320

321321
# Check whether repl is valid (GH 13438)
322-
if not is_string_like(repl) or not callable(repl):
322+
if not (is_string_like(repl) or callable(repl)):
323323
raise TypeError("repl must be a string or function")
324324
use_re = not case or len(pat) > 1 or flags or callable(repl)
325325

0 commit comments

Comments
 (0)