Skip to content

can nod concatenate character 'm' and a series #29660

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

Closed
goldenbull opened this issue Nov 16, 2019 · 2 comments
Closed

can nod concatenate character 'm' and a series #29660

goldenbull opened this issue Nov 16, 2019 · 2 comments
Labels
Duplicate Report Duplicate issue or pull request

Comments

@goldenbull
Copy link
Contributor

Code Sample, a copy-pastable example if possible

import pandas as pd

df = pd.DataFrame({"a": [1, 2, 3], })
print("m" + df["a"].astype(str))

Problem description

Traceback (most recent call last):
  File "D:/test/plot1.py", line 4, in <module>
    print("m" + df["a"].astype(str))
  File "C:\Python37\lib\site-packages\pandas\core\ops\__init__.py", line 1016, in wrapper
    assert np.isnat(right)
TypeError: ufunc 'isnat' is only defined for datetime and timedelta.

Expected Output

m1
m2
m3

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit : None python : 3.7.4.final.0 python-bits : 64 OS : Windows OS-release : 10 machine : AMD64 processor : Intel64 Family 6 Model 142 Stepping 10, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : None.None

pandas : 0.25.3
numpy : 1.17.2
pytz : 2019.2
dateutil : 2.8.0
pip : 19.3.1
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.8.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : None
odfpy : None
openpyxl : 2.6.3
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None

@hwalinga
Copy link
Contributor

This seems to be fixed in the master.

@jschendel
Copy link
Member

Yes, this is a dupe of #28658, which has been fixed on master and will be part of the 1.0 release.

In [1]: import pandas as pd; pd.__version__
Out[1]: '0.26.0.dev0+918.gcd013b41b'

In [2]: df = pd.DataFrame({"a": [1, 2, 3]})

In [3]: "m" + df["a"].astype(str)
Out[3]: 
0    m1
1    m2
2    m3
Name: a, dtype: object

@jschendel jschendel added the Duplicate Report Duplicate issue or pull request label Nov 16, 2019
@jschendel jschendel added this to the No action milestone Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants