-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
.loc assignment with empty label list should not convert dtypes #29707
Comments
A counter argument would be that the length of the label list should not influence whether the conversion should happen or not. So the behavior might be by design. |
Thanks for the report! At minimum this doesn't look like friendly behavior and should probably change. I would argue that |
Same issue exists when
|
Works now |
take |
Hi @MarvinGravert are you working on it? |
Hi @parthi-siva , |
Hi @MarvinGravert .. |
* Naive test case for #29707 * Compare frames when testing loc dtype change for #29707 * Update pandas/tests/dtypes/test_dtypes.py --------- Co-authored-by: Matthew Roeschke <[email protected]>
Code Sample
Problem description
The
.loc
-Assignment with empty label list does not change any dataframe row, so it should not convert the column datatype from integer to float.Seen with the current pandas version 0.25.3.
Output of
pd.show_versions()
pandas : 0.25.3
numpy : 1.17.4
pytz : 2019.3
dateutil : 2.8.1
pip : 19.3.1
setuptools : 41.6.0
Cython : None
pytest : None
hypothesis : None
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: