Skip to content
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

BUG: broadcasting listlike values in Series.__setitem__ GH#44265 #44275

Merged
merged 9 commits into from
Nov 5, 2021

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Nov 1, 2021

This should in turn allow us to avoid some special-casing that we do in internals/putmask_smart.

Sits on top of #44261

@jbrockmendel jbrockmendel changed the title Ref putmasks BUG: broadcasting listlike values in Series.__setitem__ GH#44265 Nov 1, 2021
@lithomas1 lithomas1 added Bug Indexing Related to indexing on series/frames, not to indexes themselves Nested Data Data where the values are collections (lists, sets, dicts, objects, etc.). labels Nov 2, 2021
@jbrockmendel
Copy link
Member Author

@jreback following this we can get rid of both putmask_preserve and putmask_without_repeat

@jreback
Copy link
Contributor

jreback commented Nov 4, 2021

can you rebase

@jbrockmendel
Copy link
Member Author

rebased + greenish

@@ -309,7 +307,17 @@ def test_broadcast(size, mask, item, box):
)

s = Series(data)
s[selection] = box(item)

if selection.sum() != 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm maybe make this another test

it's really confusing u r boxing first then setting it after

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, updated

@jbrockmendel
Copy link
Member Author

updated + greenish

@jreback jreback added this to the 1.4 milestone Nov 5, 2021
@jreback
Copy link
Contributor

jreback commented Nov 5, 2021

lgtm @phofl if you can have a look

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

lgtm

@phofl phofl merged commit 8d868db into pandas-dev:master Nov 5, 2021
@phofl
Copy link
Member

phofl commented Nov 5, 2021

thx @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Nested Data Data where the values are collections (lists, sets, dicts, objects, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG/API: Series[mask] = (item,) unpacking item
4 participants