-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix for .str.replace with repl function
.str.replace now accepts a callable (function) as replacement string. It now raises a TypeError when repl is not string like nor a callable. Docstring updated accordingly. closes #15055 Author: Joost Kranendonk <Joost.Kranendonk@hzpc.nl> Author: Joost Kranendonk <joost.kranendonk@hzpc.nl> Closes #15056 from hzpc-joostk/pandas-GH15055-patch-1 and squashes the following commits: 826730c [Joost Kranendonk] simplify .str.replace TypeError reraising and test 90779ce [Joost Kranendonk] fix linting issues c2cc13a [Joost Kranendonk] Update v0.20.0.txt e15dcdf [Joost Kranendonk] fix bug catch TypeError with wrong number of args 40c0d97 [Joost Kranendonk] improve .str.replace with callable f15ee2a [Joost Kranendonk] improve test .str.replace with callable 14beb21 [Joost Kranendonk] Add test for .str.replace with regex named groups 27065a2 [Joost Kranendonk] Reraise TypeError only with wrong number of args ae04a3e [Joost Kranendonk] Add whatsnew for .str.replace with callable repl 067a7a8 [Joost Kranendonk] Fix testing bug for .str.replace 30d4727 [Joost Kranendonk] Bug fix in .str.replace type checking done wrong 4baa0a7 [Joost Kranendonk] add tests for .str.replace with callable repl 91c883d [Joost Kranendonk] Update .str.replace docstring 6ecc43d [Joost Kranendonk] BUG: Fix for .str.replace with repl function
- Loading branch information
Showing
4 changed files
with
121 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters