-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: array-like quantile fails on column groupby #38173
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
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.
lgtm. @TomAugspurger @jbrockmendel if you have a moment to review
pandas/core/groupby/groupby.py
Outdated
) | ||
.T.flatten() | ||
) | ||
return result.take(indices, axis=1) |
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.
could a lot of this be shared with the axis=0 version by replacing result.columns with result.axes[1]
and above replacing result.index
with result.axes[0]
? (which in both cases would then become result.axes[axis]
)
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.
sounds good, I will change this.
doc/source/whatsnew/v1.2.0.rst
Outdated
@@ -734,6 +734,7 @@ Groupby/resample/rolling | |||
- Bug in :meth:`DataFrame.groupby` dropped ``nan`` groups from result with ``dropna=False`` when grouping over a single column (:issue:`35646`, :issue:`35542`) | |||
- Bug in :meth:`.DataFrameGroupBy.head`, :meth:`.DataFrameGroupBy.tail`, :meth:`SeriesGroupBy.head`, and :meth:`SeriesGroupBy.tail` would raise when used with ``axis=1`` (:issue:`9772`) | |||
- Bug in :meth:`.DataFrameGroupBy.transform` would raise when used with ``axis=1`` and a transformation kernel (e.g. "shift") (:issue:`36308`) | |||
- Bug in :meth:`.DataFrameGroupBy.quantile` couldn't handle with arraylike ``q`` when grouping by columns (:issue:`35269`) |
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.
extra period snuck in
thanks @GYHHAHA very nice |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff