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

API: User-control of result keys in GroupBy.apply #34998

Merged
merged 110 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
0fa2104
API: User-control of result keys
TomAugspurger Jun 25, 2020
13a38a2
wip
TomAugspurger Jun 26, 2020
ebb2a2d
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jun 26, 2020
f8d646f
mmm
TomAugspurger Jun 26, 2020
623526c
updates
TomAugspurger Jun 26, 2020
6871ed0
fixups
TomAugspurger Jun 26, 2020
00ce5dc
test fixups
TomAugspurger Jun 29, 2020
c28f176
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jun 29, 2020
c0b1140
update doctests
TomAugspurger Jun 29, 2020
cfd4d73
resample
TomAugspurger Jun 29, 2020
c05b1ea
warning
TomAugspurger Jun 29, 2020
919a4c7
remove debug
TomAugspurger Jun 29, 2020
4a45ea0
warning
TomAugspurger Jun 29, 2020
7f1478f
warning
TomAugspurger Jun 29, 2020
a1d4da8
warning
TomAugspurger Jun 29, 2020
9c229c6
wip
TomAugspurger Jun 29, 2020
f1a570b
wip
TomAugspurger Jun 30, 2020
7520dd3
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jun 30, 2020
914c7cf
more
TomAugspurger Jun 30, 2020
7fd1a07
Add resample tests
TomAugspurger Jul 1, 2020
29f79ce
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 1, 2020
76e6873
extension
TomAugspurger Jul 1, 2020
7f5cd0d
fixups
TomAugspurger Jul 1, 2020
d21dfb8
lint
TomAugspurger Jul 1, 2020
6e253c3
fix doc warning
TomAugspurger Jul 1, 2020
8efe632
lint
TomAugspurger Jul 1, 2020
bda914e
whatsnew
TomAugspurger Jul 1, 2020
3789fd7
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 2, 2020
80c789e
ignore for now
TomAugspurger Jul 2, 2020
c4f6e2d
avoid mutating
TomAugspurger Jul 2, 2020
d123a80
comment on override_group_keys
TomAugspurger Jul 2, 2020
9cb58a3
fixups
TomAugspurger Jul 3, 2020
3421402
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 6, 2020
2e59629
typing
TomAugspurger Jul 6, 2020
8fd0de5
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 6, 2020
13965b2
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 6, 2020
bfb854e
fixups
TomAugspurger Jul 6, 2020
244fec6
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 6, 2020
7469b29
mypy
TomAugspurger Jul 6, 2020
16e0f5f
mypy
TomAugspurger Jul 6, 2020
4173a32
lint
TomAugspurger Jul 6, 2020
cd112cd
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 7, 2020
d984e9e
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 12, 2020
b6af0da
fixup
TomAugspurger Jul 12, 2020
8e46a6e
change ref
TomAugspurger Jul 12, 2020
d745c4a
fixup whatsnew
TomAugspurger Jul 12, 2020
23caf8e
fixup whatsnew
TomAugspurger Jul 12, 2020
b9b2e53
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 13, 2020
3d4a744
doc
TomAugspurger Jul 13, 2020
4d984d9
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Jul 14, 2020
5d12ba4
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Aug 6, 2020
20d8520
remove xpass
TomAugspurger Aug 6, 2020
cb9217a
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Aug 7, 2020
7cf051a
Fixup
TomAugspurger Aug 7, 2020
e0972fc
Merge remote-tracking branch 'upstream/master' into 34809-result-type
TomAugspurger Sep 4, 2020
ad0f292
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
rhshadrach Jan 2, 2021
b3c8d53
merge cleanup and pass tests
rhshadrach Jan 2, 2021
08ae03f
Move docs to 1.3, avoid warnings in tests
rhshadrach Jan 3, 2021
f055193
Revert group_keys=False when apply is not used
rhshadrach Jan 3, 2021
d4f24a6
Merge branch 'master' of https://github.com/pandas-dev/pandas into 34…
rhshadrach Jan 3, 2021
c1953e6
Avoid warnings when using apply internally, bare xfail/FutureWarning …
rhshadrach Jan 3, 2021
47dec36
Merge branch 'master' of https://github.com/pandas-dev/pandas into 34…
rhshadrach Jan 3, 2021
74b98e1
Remove group_keys from DataFrame.resample, parametrize one test
rhshadrach Jan 3, 2021
a547d63
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
rhshadrach Jan 4, 2021
20d7663
Doc changes
rhshadrach Jan 4, 2021
c3bccb3
Remove group_keys from NDFrame.resample
rhshadrach Jan 4, 2021
7f7ee52
Remove group_keys from Series.resample
rhshadrach Jan 4, 2021
4f652a9
Fixed _is_indexed_like bug
rhshadrach Jan 4, 2021
499ecd4
Minor fixups
rhshadrach Jan 4, 2021
d1f2d29
whatsnew
rhshadrach Jan 4, 2021
45cd980
Restored group_keys in resample, defaults to no_default
rhshadrach Jan 9, 2021
c3f8258
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
rhshadrach Jan 9, 2021
804312a
Fixed stacklevel for resample warning, simplified test
rhshadrach Jan 9, 2021
a7d5a0e
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
rhshadrach Jan 12, 2021
a5ce219
whatsnew and docstring for DataFrame.resample
rhshadrach Jan 12, 2021
15b1556
Revert accidental changes
rhshadrach Jan 12, 2021
d3de668
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
rhshadrach Jan 26, 2021
f80c4c0
Removed unnecessary group_keys in tests
rhshadrach Jan 26, 2021
62c42e8
Removed unnecessary xfail, testing equals instead of is
rhshadrach Jan 26, 2021
bf4b126
Revert is -> eqauls change
rhshadrach Jan 27, 2021
565791a
Merge branch 'master' of https://github.com/pandas-dev/pandas into 34…
rhshadrach Nov 13, 2021
2b02b6f
fixups
rhshadrach Nov 14, 2021
3e175f9
Test fixup
rhshadrach Nov 14, 2021
7f3cc48
Update verison to 1.4.0, use find_stack_level
rhshadrach Nov 14, 2021
0c0b2c5
Cleanups
rhshadrach Nov 14, 2021
f46c59a
Added test
rhshadrach Nov 14, 2021
27ed908
type-hint fixups
rhshadrach Nov 14, 2021
1200c55
Merge branch 'master' of https://github.com/pandas-dev/pandas into 34…
rhshadrach Nov 25, 2021
d4a36b7
Merge branch '34809-result-type' of https://github.com/TomAugspurger/…
rhshadrach Nov 25, 2021
c84fa45
Doc fixups
rhshadrach Dec 5, 2021
2912d88
Merge branch '34809-result-type' of https://github.com/TomAugspurger/…
rhshadrach Dec 5, 2021
f3d94a8
Merge branch 'master' of https://github.com/pandas-dev/pandas into 34…
rhshadrach Dec 5, 2021
1bd1e0e
Merge branch 'master' of https://github.com/pandas-dev/pandas into 34…
rhshadrach Jan 1, 2022
39d54fc
Merge main
rhshadrach Jan 22, 2022
808efc4
Move notes from 1.4 to 1.5, added deprecation note for .groupby(...).…
rhshadrach Jan 22, 2022
215d9a8
Avoid warnings, is_empty_agg -> is_agg
rhshadrach Jan 22, 2022
0c8274c
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Jan 26, 2022
c312e90
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Jan 31, 2022
30d0f23
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Feb 5, 2022
1c01624
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Feb 8, 2022
14b9b0f
Suppress warning in tests
rhshadrach Feb 8, 2022
09da38e
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Feb 13, 2022
d771ae1
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Feb 20, 2022
cb4bed6
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Feb 27, 2022
4ea1550
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Mar 15, 2022
eace964
Merge branch '34809-result-type' of https://github.com/TomAugspurger/…
rhshadrach Mar 15, 2022
6407abd
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Mar 22, 2022
deb5479
Merge branch '34809-result-type' of https://github.com/TomAugspurger/…
rhshadrach Mar 22, 2022
a0fd04c
Merge cleanup
rhshadrach Mar 23, 2022
f9aa547
Merge branch 'main' of https://github.com/pandas-dev/pandas into 3480…
rhshadrach Mar 28, 2022
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
14 changes: 6 additions & 8 deletions doc/source/user_guide/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1017,16 +1017,14 @@ for both ``aggregate`` and ``transform`` in many standard use cases. However,

The dimension of the returned result can also change:

.. ipython::

In [8]: grouped = df.groupby('A')['C']
.. ipython:: python
rhshadrach marked this conversation as resolved.
Show resolved Hide resolved
rhshadrach marked this conversation as resolved.
Show resolved Hide resolved

In [10]: def f(group):
....: return pd.DataFrame({'original': group,
....: 'demeaned': group - group.mean()})
....:
grouped = df.groupby('A', group_keys=False)['C']

In [11]: grouped.apply(f)
def f(group):
return pd.DataFrame({'original': group,
'demeaned': group - group.mean()})
grouped.apply(f)
rhshadrach marked this conversation as resolved.
Show resolved Hide resolved

``apply`` on a Series can operate on a returned value from the applied function,
that is itself a series, and possibly upcast the result to a DataFrame:
Expand Down
11 changes: 8 additions & 3 deletions doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,15 @@ Now every group is evaluated only a single time.

*New behavior*:

.. ipython:: python

df.groupby("a").apply(func)
.. code-block:: python

In [3]: df.groupby('a').apply(func)
x
y
Out[3]:
a b
0 x 1
1 y 2

Concatenating sparse values
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
53 changes: 53 additions & 0 deletions doc/source/whatsnew/v1.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,59 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor

Deprecations
~~~~~~~~~~~~

:meth:`~DataFrame.groupby` no longer ignores ``group_keys`` for transform-like ``apply``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:meth:`~DataFrame.groupby` will no longer ignore the ``group_keys`` argument for functions passed to ``apply`` that return like-indexed outputs (:issue:`34809`, :issue:`31612`, :issue:`14927`, :issue:`13056`).
Previous versions of pandas would add the group keys only when the result from the applied function had a different index to the input.

*Previous behavior*:

.. code-block:: python

>>> # pandas 1.0.4
>>> df = pd.DataFrame({"A": [1, 2, 2], "B": [1, 2, 3]})
>>> df
A B
0 1 1
1 2 2
2 2 3
>>> df.groupby("A").apply(lambda x: x.rename(np.exp)) # Different index
A B
A
1 1.000000 1 1
2 2.718282 2 2
7.389056 2 3

>>> df.groupby("A").apply(lambda x: x) # Same index
A B
0 1 1
1 2 2
2 2 3

In this future this behavior will change to always respect ``group_keys``, which defaults to True.

*New behavior*:

.. ipython:: python

df = pd.DataFrame({"A": [1, 2, 2], "B": [1, 2, 3]})
df.groupby("A", group_keys=True).apply(lambda x: x)
df.groupby("A", group_keys=True).apply(lambda x: x.rename(np.exp))

A warning will be issued if the result would change from pandas 1.0.4

.. ipython:: python
:okwarning:

df.groupby("A").apply(lambda x: x)


Other Deprecations
^^^^^^^^^^^^^^^^^^

-
- Deprecated parameter ``inplace`` in :meth:`MultiIndex.set_codes` and :meth:`MultiIndex.set_levels` (:issue:`35626`)
- Deprecated parameter ``dtype`` in :~meth:`Index.copy` on method all index classes. Use the :meth:`Index.astype` method instead for changing dtype(:issue:`35853`)
-
Expand Down
11 changes: 10 additions & 1 deletion pandas/_libs/reduction.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,16 @@ def apply_frame_axis0(object frame, object f, object names,
mutated = True
except AttributeError:
# `piece` might not have an index, could be e.g. an int
pass
# By definition, we are not a transform, so set mutated
jreback marked this conversation as resolved.
Show resolved Hide resolved
# to True
mutated = True
jreback marked this conversation as resolved.
Show resolved Hide resolved
if not mutated:
# Also check if the columns are mutated
try:
if not piece.columns.equals(chunk.columns):
mutated = True
except AttributeError:
mutated = True

if not is_scalar(piece):
# Need to copy data to avoid appending references
Expand Down
22 changes: 21 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6516,6 +6516,26 @@ def update(
a 13.0 13.0
b 12.3 123.0
NaN 12.3 33.0

When using ``.apply()``, use ``group_keys`` to include or exclude the group keys.

>>> df = pd.DataFrame({'Animal': ['Falcon', 'Falcon',
... 'Parrot', 'Parrot'],
... 'Max Speed': [380., 370., 24., 26.]})
>>> df.groupby("Animal", group_keys=False).apply(lambda x: x)
Animal Max Speed
0 Falcon 380.0
1 Falcon 370.0
2 Parrot 24.0
3 Parrot 26.0

>>> df.groupby("Animal", group_keys=True).apply(lambda x: x)
rhshadrach marked this conversation as resolved.
Show resolved Hide resolved
Animal Max Speed
Animal
Falcon 0 Falcon 380.0
1 Falcon 370.0
Parrot 2 Parrot 24.0
3 Parrot 26.0
"""
)
@Appender(_shared_docs["groupby"] % _shared_doc_kwargs)
Expand All @@ -6526,7 +6546,7 @@ def groupby(
level=None,
as_index: bool = True,
sort: bool = True,
group_keys: bool = True,
group_keys: bool = no_default,
squeeze: bool = no_default,
observed: bool = False,
dropna: bool = True,
Expand Down
89 changes: 89 additions & 0 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7411,6 +7411,87 @@ def clip(

return result

_shared_docs[
"groupby"
] = """
Group %(klass)s using a mapper or by a Series of columns.

A groupby operation involves some combination of splitting the
object, applying a function, and combining the results. This can be
used to group large amounts of data and compute operations on these
groups.

Parameters
----------
by : mapping, function, label, or list of labels
Used to determine the groups for the groupby.
If ``by`` is a function, it's called on each value of the object's
index. If a dict or Series is passed, the Series or dict VALUES
will be used to determine the groups (the Series' values are first
aligned; see ``.align()`` method). If an ndarray is passed, the
values are used as-is determine the groups. A label or list of
labels may be passed to group by the columns in ``self``. Notice
that a tuple is interpreted as a (single) key.
axis : {0 or 'index', 1 or 'columns'}, default 0
Split along rows (0) or columns (1).
level : int, level name, or sequence of such, default None
If the axis is a MultiIndex (hierarchical), group by a particular
level or levels.
as_index : bool, default True
For aggregated output, return object with group labels as the
index. Only relevant for DataFrame input. as_index=False is
effectively "SQL-style" grouped output.
sort : bool, default True
Sort group keys. Get better performance by turning this off.
Note this does not influence the order of observations within each
group. Groupby preserves the order of rows within each group.
group_keys : bool, optional
When calling apply, add group keys to index to identify pieces.
By default group keys are not included when the result's index
(and column) labels match the inputs, and are included otherwise.

.. versionchanged:: 1.2.0

Warns that `group_keys` will no longer be ignored when the
result from ``apply`` is a like-indexed Series or DataFrame.
Specify ``group_keys`` explicitly to include the group keys or
not.

squeeze : bool, default False
Reduce the dimensionality of the return type if possible,
otherwise return a consistent type.

.. deprecated:: 1.1.0

observed : bool, default False
This only applies if any of the groupers are Categoricals.
If True: only show observed values for categorical groupers.
If False: show all values for categorical groupers.

.. versionadded:: 0.23.0
dropna : bool, default True
If True, and if group keys contain NA values, NA values together
with row/column will be dropped.
If False, NA values will also be treated as the key in groups

.. versionadded:: 1.1.0

Returns
-------
%(klass)sGroupBy
Returns a groupby object that contains information about the groups.

See Also
--------
resample : Convenience method for frequency conversion and resampling
of time series.

Notes
-----
See the `user guide
<https://pandas.pydata.org/pandas-docs/stable/groupby.html>`_ for more.
"""

def asfreq(
self: FrameOrSeries,
freq,
Expand Down Expand Up @@ -7678,6 +7759,7 @@ def resample(
level=None,
origin: Union[str, TimestampConvertibleTypes] = "start_day",
offset: Optional[TimedeltaConvertibleTypes] = None,
group_keys: bool_t = lib.no_default,
) -> "Resampler":
"""
Resample time-series data.
Expand Down Expand Up @@ -7747,6 +7829,12 @@ def resample(

.. versionadded:: 1.1.0

group_keys : bool, default True
Whether to include the group keys in the result index when performing
a ``.groupby().apply()`` to the resampled object.

.. versionadded:: 1.2.0

Returns
-------
Resampler object
Expand Down Expand Up @@ -8063,6 +8151,7 @@ def resample(
level=level,
origin=origin,
offset=offset,
group_keys=group_keys,
)

def first(self: FrameOrSeries, offset) -> FrameOrSeries:
Expand Down
58 changes: 43 additions & 15 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,11 @@ def _wrap_transformed_output(
return result

def _wrap_applied_output(
self, keys: Index, values: Optional[List[Any]], not_indexed_same: bool = False
self,
keys: Index,
values: Optional[List[Any]],
not_indexed_same: bool = False,
override_group_keys: bool = False,
) -> FrameOrSeriesUnion:
"""
Wrap the output of SeriesGroupBy.apply into the expected result.
Expand Down Expand Up @@ -466,7 +470,12 @@ def _get_index() -> Index:
result.name = self._selection_name
return result
elif isinstance(values[0], (Series, DataFrame)):
return self._concat_objects(keys, values, not_indexed_same=not_indexed_same)
return self._concat_objects(
keys,
values,
not_indexed_same=not_indexed_same,
override_group_keys=override_group_keys,
)
else:
# GH #6265 #24880
result = self.obj._constructor(
Expand Down Expand Up @@ -1190,7 +1199,13 @@ def _aggregate_item_by_item(self, func, *args, **kwargs) -> DataFrame:

return self.obj._constructor(result, columns=result_columns)

def _wrap_applied_output(self, keys, values, not_indexed_same=False):
def _wrap_applied_output(
self,
keys,
values,
not_indexed_same: bool = False,
override_group_keys: bool = False,
) -> FrameOrSeriesUnion:
if len(keys) == 0:
return self.obj._constructor(index=keys)

Expand All @@ -1201,18 +1216,23 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):
# GH9684 - All values are None, return an empty frame.
return self.obj._constructor()
elif isinstance(first_not_none, DataFrame):
return self._concat_objects(keys, values, not_indexed_same=not_indexed_same)
return self._concat_objects(
keys,
values,
not_indexed_same=not_indexed_same,
override_group_keys=override_group_keys,
)
else:
key_index = self.grouper.result_index if self.as_index else None

if isinstance(first_not_none, Series):

if isinstance(first_not_none, (Series, DataFrame)):
# this is to silence a DeprecationWarning
# TODO: Remove when default dtype of empty Series is object
kwargs = first_not_none._construct_axes_dict()
backup = create_series_with_explicit_dtype(
dtype_if_empty=object, **kwargs
)
backup: FrameOrSeriesUnion
if isinstance(first_not_none, Series):
kwargs["dtype_if_empty"] = object
TomAugspurger marked this conversation as resolved.
Show resolved Hide resolved
backup = create_series_with_explicit_dtype(**kwargs)

values = [x if (x is not None) else backup for x in values]

Expand All @@ -1239,7 +1259,10 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):
# OR we don't have a multi-index and we have only a
# single values
return self._concat_objects(
keys, values, not_indexed_same=not_indexed_same
keys,
values,
not_indexed_same=not_indexed_same,
override_group_keys=override_group_keys,
)

# still a series
Expand All @@ -1251,7 +1274,12 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):

if not all_indexed_same:
# GH 8467
return self._concat_objects(keys, values, not_indexed_same=True)
return self._concat_objects(
keys,
values,
not_indexed_same=True,
override_group_keys=override_group_keys,
)

# GH6124 if the list of Series have a consistent name,
# then propagate that name to the result.
Expand Down Expand Up @@ -1621,13 +1649,13 @@ def _gotitem(self, key, ndim: int, subset=None):
subset = self.obj[key]
return SeriesGroupBy(
subset,
level=self.level,
grouper=self.grouper,
selection=key,
sort=self.sort,
grouper=self.grouper,
observed=self.observed,
group_keys=self.group_keys,
level=self.level,
sort=self.sort,
squeeze=self.squeeze,
observed=self.observed,
dropna=self.dropna,
)

Expand Down
Loading