Skip to content
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

BUG: str.cat produces NaNs when others is an Index #33425

Closed
3 tasks
brandon-b-miller opened this issue Apr 9, 2020 · 0 comments · Fixed by #33436
Closed
3 tasks

BUG: str.cat produces NaNs when others is an Index #33425

brandon-b-miller opened this issue Apr 9, 2020 · 0 comments · Fixed by #33436
Labels
Bug Strings String extension data type and string data
Milestone

Comments

@brandon-b-miller
Copy link

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Code Sample, a copy-pastable example

import pandas as pd
print(pd.__version__)

sr = pd.Series(['a','b','c','d','e'])
others = pd.Index(['a','b','c','d','e'])

result = sr.str.cat(others=others)
print(result)

1.0.3
0    NaN
1    NaN
2    NaN
3    NaN
4    NaN
dtype: object

Problem description

The result should be the same as when others is a list or numpy array with the same values. The result is correct for pandas < 1.0.

Expected Output

0    aa
1    bb
2    cc
3    dd
4    ee
dtype: object

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Linux
OS-release : 4.4.0-134-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.0.3
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 46.1.1.post20200322
Cython : 0.29.15
pytest : 5.4.1
hypothesis : 5.7.0
sphinx : 2.4.4
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.13.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.15.0
pytables : None
pytest : 5.4.1
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : 0.48.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Strings String extension data type and string data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants