Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
.replace() raises when replacing strings #21078
Code Sample, a copy-pastable example if possible
pd.Series(['a', 'b', 'c']).replace('a', 'x')
This raises the following error:
This behavior is exclusive to the new version 0.23. Previous versions work as expected.
That works fine on 3.5.4 for me.
Python 3.5.4 | packaged by conda-forge | (default, Aug 10 2017, 01:41:15) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> import typing >>> isinstance(re.compile(''), typing.re.Pattern) True >>>
Can you try upgrading from 3.5.1 to a later point release?