-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Series replace, unexpected fill behavior #19998
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
Comments
is actually equivalent to
because when I agree that the docs for |
@reidy-p : Excellent explanation! |
Thanks @reidy-p for details and the very relevant link to #17673. I would agree with your assessment that So, if the task is to improve the docstring, my concrete suggestion is this: Clarify under the Many thanks for your excellent work. |
These are good suggestions. I think it would be good if the @gfyoung what do you think of this idea? If this isn't possible, then I think we should at least add the docstring improvement suggested by @rasmuse |
Many thanks for the excellent software. This report is about behavior I did not expect. Not sure if it is a bug or not.
Problem description
This behavior was unexpected for me. I would have assumed that these two lines would produce the same output:
In my particular use case, I was actually looking to just replace
'a'
withNone
and therefore dids.replace('a', None)
. I did not check output carefully and therefore ended up with some very strange behavior down the line in my data analysis.Not sure if this is to be considered a bug or not. Docs are not entirely clear on what is intended behavior. Possible solutions could include
s.replace('a', numpy.nan)
might be a better option.Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-116-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.22.0
pytest: None
pip: 9.0.1
setuptools: 38.5.1
Cython: None
numpy: 1.14.0
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2018.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: