Closed
Description
Using Pandas 0.12.0
It's hard to think of why a DataFrame would allow a regex=True
replace method, and a Series wouldn't. This must just be an oversight, right?
>>> test = pd.DataFrame(['hello','goodbye','thankyou'],columns=['to_replace'])
>>> test
to_replace
0 hello
1 goodbye
2 thankyou
>>> test.replace("he", "je")
to_replace
0 hello
1 goodbye
2 thankyou
>>> test.replace("he", "je", regex=True)
to_replace
0 jello
1 goodbye
2 thankyou
>>> test['to_replace'].replace("he", "je", regex=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: replace() got an unexpected keyword argument 'regex'