Skip to content

BUG: iloc.setitem raising NotImplementedError for all null slice with one column df #47987

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

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

phofl
Copy link
Member

@phofl phofl commented Aug 5, 2022

@phofl phofl added Indexing Related to indexing on series/frames, not to indexes themselves Strings String extension data type and string data NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Aug 5, 2022
Comment on lines 1719 to +1724
elif lib.is_integer(indexer[1]) and indexer[1] == 0:
# reached via setitem_single_block passing the whole indexer
indexer = indexer[0]

elif com.is_null_slice(indexer[1]):
indexer = indexer[0]
Copy link
Contributor

@weikhor weikhor Aug 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small opinion. Is it better if we combine together condition like this?

elif (lib.is_integer(indexer[1]) and indexer[1] == 0) or (com.is_null_slice(indexer[1])):
     # reached via setitem_single_block passing the whole indexer
     indexer = indexer[0]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it into two because this is easier to read imo

@mroeschke mroeschke added this to the 1.5 milestone Aug 8, 2022
@mroeschke mroeschke merged commit 43c0508 into pandas-dev:main Aug 8, 2022
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the 45469 branch August 8, 2022 21:48
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves NA - MaskedArrays Related to pd.NA and nullable extension arrays Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Can't use iloc assign a list of None to a 1-d subset of a string dataframe.
3 participants