Skip to content

REF: de-duplicate _apply_to_group #29628

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 3 commits into from
Nov 17, 2019
Merged

Conversation

jbrockmendel
Copy link
Member

functionally identical code in SeriesGrouper.get_result and SeriesBinGrouper.get_result, now shared.

@@ -189,6 +189,24 @@ cdef class _BaseGrouper:

return cached_typ, cached_ityp

cdef inline object _apply_to_group(self,
Copy link
Contributor

Choose a reason for hiding this comment

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

i would return a tuple(res, intitialized) here, less c-like i think is good generally (and this likely doesn't make it differetnt perf wise as this is object anyhow)

object cached_typ, object cached_ityp,
Slider islider, Slider vslider,
Py_ssize_t group_size, bint* initialized):
cached_ityp._engine.clear_mapping()
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add some sort of doc-string

@jreback jreback added Groupby Refactor Internal refactoring of code labels Nov 16, 2019
@jreback jreback added this to the 1.0 milestone Nov 16, 2019
@jreback jreback merged commit 787ea54 into pandas-dev:master Nov 17, 2019
@jbrockmendel jbrockmendel deleted the red8 branch November 17, 2019 23:20
Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants