Skip to content

BUG: Preserve Series/DataFrame subclasses through groupby operations #33884

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 38 commits into from
May 13, 2020
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7da0703
Add tests to confirm groupby ops preserve subclasses
JBGreisman Apr 29, 2020
f6e1a89
Update SeriesGroupBy constructor calls to preserve subclassed Series
JBGreisman Apr 29, 2020
ee6de43
Fix concat() method to preserve subclassed DataFrames
JBGreisman Apr 29, 2020
3f9f4c4
Add GH28330 comment to concat.py
JBGreisman Apr 29, 2020
0112826
Preserve subclassing in DataFrame.idxmin() and DataFrame.idxmax() calls
JBGreisman Apr 29, 2020
422e702
GH28330 Fix GroupBy.size() to preserve subclassed types
JBGreisman Apr 29, 2020
53ac397
GH28330 Fix GroupBy.ngroup() to preserve subclassed types
JBGreisman Apr 29, 2020
2bc2520
GH28330 Fix GroupBy.cumcount() to preserve subclassed types
JBGreisman Apr 29, 2020
8d9a885
GH28330 Fix constructor calls to preserve subclasses through groupby()
JBGreisman Apr 29, 2020
e4d7fa8
Fix typo -- Series.constructor() to Series._constructor()
JBGreisman Apr 29, 2020
1dbe986
Remove DeprecationWarning due to empty Series construction
JBGreisman Apr 30, 2020
c998422
BUG: GH28330 Preserve subclassing with groupby operations
JBGreisman Apr 30, 2020
abdb861
BUG: GH28330 Preserve subclassing with groupby operations
JBGreisman Apr 30, 2020
d36ad6d
Merge remote-tracking branch 'upstream/master' into groupby-preserve-…
JBGreisman Apr 30, 2020
5b83062
Fix formatting of .py files with black
JBGreisman Apr 30, 2020
b6ea731
Removed trailing whitespace in doc/source/whatsnew/v1.1.0.rst
JBGreisman Apr 30, 2020
0cdf0ea
Update DataFrameGroupBy._cython_agg_blocks() to pass mypy
JBGreisman Apr 30, 2020
6e48e07
Merge remote-tracking branch 'upstream/master' into groupby-preserve-…
JBGreisman Apr 30, 2020
a70c21a
Remove unused import of typing.cast from pandas/core/groupby/generic.py
JBGreisman Apr 30, 2020
c03d459
Move tests to test_groupby_subclass.py
JBGreisman Apr 30, 2020
9e42c79
Add tests for DataFrame.idxmin() and DataFrame.idxmax() with subclasses
JBGreisman Apr 30, 2020
9fbc645
Add test to confirm concat() preserves subclassed types
JBGreisman Apr 30, 2020
5750d72
Update whatsnew entry bugfix
JBGreisman Apr 30, 2020
7f4c5a7
Merge remote-tracking branch 'upstream/master' into groupby-preserve-…
JBGreisman Apr 30, 2020
8eee73c
Revert unnecessary changes in GroupBy()
JBGreisman May 1, 2020
4b304c1
Fix test to expect Series from GroupBy.ngroup() and GroupBy.cumcount()
JBGreisman May 1, 2020
b3e039a
Fix formatting of groupby.py
JBGreisman May 1, 2020
b1118de
Merge remote-tracking branch 'upstream/master' into groupby-preserve-…
JBGreisman May 1, 2020
a490e38
Avoid DeprecationWarning by checking for instance of Series
JBGreisman May 1, 2020
5bcf9fa
Merge remote-tracking branch 'upstream/master' into groupby-preserve-…
JBGreisman May 1, 2020
0244b36
Remove unnecessary constructor call in DataFrameGroupBy._cython_agg_b…
JBGreisman May 3, 2020
dcd4692
Fix mypy static typing issue in DataFrameGroupBy._cython_agg_blocks()
JBGreisman May 3, 2020
a92c51b
Ensure consistent return types for GroupBy.size(), ngroup(), and cumc…
JBGreisman May 3, 2020
cf3b978
Revert DataFrameGroupBy._cython_agg_blocks() back to origin/master
JBGreisman May 11, 2020
f08cf59
Add GroupBy._constructor() to facilitate preserving subclassed types
JBGreisman May 11, 2020
d2a7de2
Change DataFrameGroupBy._transform_fast() to use _constructor property
JBGreisman May 12, 2020
37ea97f
Restructure GroupBy._constructor() to remove else statement
JBGreisman May 12, 2020
f1570da
Rename GroupBy._constructor property to GroupBy._obj_1d_constructor
JBGreisman May 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BUG: GH28330 Preserve subclassing with groupby operations
  • Loading branch information
JBGreisman committed Apr 30, 2020
commit abdb86147e3216c73097bdfa7e9b040649277cd6
3 changes: 2 additions & 1 deletion doc/source/whatsnew/v1.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ Groupby/resample/rolling
- Bug in :meth:`DataFrame.groupby` where a ``ValueError`` would be raised when grouping by a categorical column with read-only categories and ``sort=False`` (:issue:`33410`)
- Bug in :meth:`GroupBy.first` and :meth:`GroupBy.last` where None is not preserved in object dtype (:issue:`32800`)
- Bug in :meth:`Rolling.min` and :meth:`Rolling.max`: Growing memory usage after multiple calls when using a fixed window (:issue:`30726`)

- Bug where subclasses were not preserved through groupby operations (:issue:`28330`)

Reshaping
^^^^^^^^^

Expand Down