-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: iloc setting columns not taking effect #33381
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
Conversation
are you running the full test suite locally before pushing? |
Not fully. usually only the parts I suspect that are related to the changes I make, in this case I tried on |
Unless you need to save the wattage, its usually good to run the full thing. e.g. i have in .bash_aliases In this case we might expect tests.indexing, tests.frame.indexing, tests.series.indexing, and possibly tests.indexes to be potential trouble spots |
That's a good tip. |
pandas/core/indexing.py
Outdated
@@ -1557,7 +1557,10 @@ def _setitem_with_indexer(self, indexer, value): | |||
(blk,) = self.obj._mgr.blocks | |||
if 1 < blk.ndim: # in case of dict, keys are indices | |||
val = list(value.values()) if isinstance(value, dict) else value | |||
take_split_path = not blk._can_hold_element(val) | |||
if isinstance(indexer, tuple) and com.is_null_slice(indexer[0]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment pointing back to this or the original issue
@@ -31,6 +31,15 @@ | |||
_slice_msg = "slice indices must be integers or None or have an __index__ method" | |||
|
|||
|
|||
def test_unsure_about_the_name_and_location(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to make a test_iloc.py file in this directory, might as well do it in this PR
Looking at the test logs, there's still some more troubleshooting to be done. What's the next step? |
@jbrockmendel Looks like we need to check for the length of the index of each one, to decide if we are taking the split path. what I tried was: val = list(value.values()) if isinstance(value, dict) else value
# https://github.com/pandas-dev/pandas/issues/33198
if isinstance(indexer, tuple) and com.is_null_slice(indexer[0]):
take_spit_path = length_of_indexer(
self.obj.index
) == length_of_indexer(indexer[0]) But it does not work. |
Let's continue troubleshooting in #33198. Closing to clear the queue, can re-open when its ready to go. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff