Commit 50c40ff
BUG: Fix regression on DataFrame.replace for regex (#25266)
* BUG: Fix regression on DataFrame.replace for regex
The commit ensures that the replacement for regex is not confined to the
beginning of the string but spans all the characters within. The
behaviour is then consistent with versions prior to 0.24.0.
One test has been added to account for character replacement when the
character is not at the beginning of the string.1 parent 64e5612 commit 50c40ff
File tree
3 files changed
+14
-6
lines changed- doc/source/whatsnew
- pandas
- core/internals
- tests/frame
3 files changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
556 | | - | |
557 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| |||
1897 | 1897 | | |
1898 | 1898 | | |
1899 | 1899 | | |
1900 | | - | |
| 1900 | + | |
1901 | 1901 | | |
1902 | 1902 | | |
1903 | 1903 | | |
1904 | | - | |
| 1904 | + | |
1905 | 1905 | | |
1906 | 1906 | | |
1907 | 1907 | | |
| |||
1917 | 1917 | | |
1918 | 1918 | | |
1919 | 1919 | | |
1920 | | - | |
| 1920 | + | |
1921 | 1921 | | |
1922 | 1922 | | |
1923 | 1923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
469 | 476 | | |
470 | 477 | | |
471 | 478 | | |
| |||
0 commit comments