Skip to content

CLN: dont consolidate in indexing #34679

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

Conversation

jbrockmendel
Copy link
Member

No description provided.

@jreback jreback added Clean Performance Memory or execution speed performance labels Jun 9, 2020
@jreback jreback added this to the 1.1 milestone Jun 9, 2020
@jreback jreback added the Indexing Related to indexing on series/frames, not to indexes themselves label Jun 9, 2020
@@ -1676,7 +1676,6 @@ def isetter(loc, v):
ser = v
else:
# set the item, possibly having a dtype change
ser._consolidate_inplace()
Copy link
Member

Choose a reason for hiding this comment

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

this one is a no-op since ser is a series (I think?), so can easily be removed

Copy link
Member Author

Choose a reason for hiding this comment

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

This is my thought too

@@ -1788,7 +1787,6 @@ def isetter(loc, v):
self.obj._check_is_chained_assignment_possible()

# actually do the set
self.obj._consolidate_inplace()
Copy link
Member

Choose a reason for hiding this comment

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

Removing this one will need a performance check, IMO, and also has potential API changes that might need investigation

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this consolidation turns out to be redundant with the self.obj._is_mixed_type check near the start of this method, since also does consolidate_inplace under the hood (though id prefer that it didnt)

and also has potential API changes that might need investigation

I've been thinking about this, since the same issue came up on the last call w/r/t always-view column-indexing. It isn't clear to me what type/amount of "investigation" would satisfy this concern. Do you have something in mind?

@jbrockmendel
Copy link
Member Author

reverted the non-consensus edit

@jbrockmendel
Copy link
Member Author

gentle ping. This is now just the 1-line edit

@jreback jreback merged commit 0159cba into pandas-dev:master Jun 26, 2020
@jreback
Copy link
Contributor

jreback commented Jun 26, 2020

lgtm

@jbrockmendel jbrockmendel deleted the perf-consolidate-less-indexing branch June 27, 2020 00:21
fangchenli pushed a commit to fangchenli/pandas that referenced this pull request Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Indexing Related to indexing on series/frames, not to indexes themselves Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants