Inconsistent dtype changes between multi-column assignment and single-column assignment #27583
Labels
Dtype Conversions
Unexpected or buggy dtype conversions
good first issue
Indexing
Related to indexing on series/frames, not to indexes themselves
Needs Tests
Unit test(s) needed to prevent regressions
Code Sample, a copy-pastable example if possible
Output:
Problem description
As you can see above, the column type doesn't change in multi-column assignment but changes from
float64
toint64
in single-column assignment. This behavior seems quite inconsistent.Expected Output
Both multi-column assignment and single-column assignment should result in the correct dtype.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 3b96ada
python : 3.6.8.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-52-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.utf8
LOCALE : en_US.UTF-8
pandas : 0.25.0rc0+131.g3b96ada3a
numpy : 1.16.3
pytz : 2019.1
dateutil : 2.8.0
pip : 19.1.1
setuptools : 41.0.1
Cython : 0.29.7
pytest : 4.4.2
hypothesis : 4.17.2
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
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 : None
pytables : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: