8000 BUG/API: remove infer_types from replace and fix compiled regex bug by cpcloud · Pull Request #3909 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG/API: remove infer_types from replace and fix compiled regex bug #3909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 15, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG: fix bug with replace when a compiled regex was passed but regex=…
…False
  • Loading branch information
cpcloud committed Jun 15, 2013
commit 2f63055bc1b72c704446ab870df7dea5170ec30a
2 changes: 1 addition & 1 deletion pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def replace(self, to_replace, value, inplace=False, filter=None,
both_lists = to_rep_is_list and value_is_list
either_list = to_rep_is_list or value_is_list

if not either_list and com.is_re_compilable(to_replace):
if not either_list and com.is_re(to_replace):
blk[0], = blk[0]._replace_single(to_replace, value,
inplace=inplace, filter=filter,
regex=True)
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6778,7 +6778,6 @@ def test_replace_list(self):

## lists of regexes and values
# list of [v1, v2, ..., vN] -> [v1, v2, ..., vN]
import ipdb; ipdb.set_trace()
to_replace_res = [r'.', r'e']
values = [nan, 'crap']
res = dfobj.replace(to_replace_res, values)
Expand Down
0