-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DataFrame.iloc does not raise for setitem if empty #32896
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
This didn't silently fail on 0.25.3
922f932 is the first bad commit
|
This matches the numpy behavior:
This may be a numpy bug as well cc @seberg ? |
Yeah, I guess it technically is a NumPy bug. The reason here must be the additional empty dimension that is not being indexed, somehow causing the index check to never be run to begin with. |
yes, we recently stopped doing some validation on |
As a heads up, I am considering deprecating this for a release if that is OK? I agree that it is a straight bug, but apparently I intentionally put this in (although possibly not intentionally this exact case). |
So we'll put back in a check and raise, and then when our min numpy version catches up to 1.19(?) we can go back to falling through? If so, sounds good. |
Yeah, I suppose so. You could get away with only doing it when the result/assignment may be empty (if you want to avoid doing unnecessary/slow checks). If we deprecate, I guess it would be 1.20 otherwise 1.19, but since you need backcompat anyway, I guess it makes no real difference. |
cc @jbrockmendel This raises since cd649a2
Can we close this ? |
This is a follow-up on #32886 (comment)
test_setitem_ndarray_3d
inpandas/tests/indexing/test_indexing.py
isn't raising for empty index, iloc and DataFrame parametrization.The mentioned PR added a new
xfail
test for this combination:test_setitem_ndarray_3d_does_not_fail_for_iloc_empty_dataframe
. The goal of this PR is to remove thexfail
test and remove the associatedpytest.skip
intest_setitem_ndarray_3d
.The text was updated successfully, but these errors were encountered: