-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: groupby numeric_only default #47025
DEPR: groupby numeric_only default #47025
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.
not a fan of filterwarnings, i know its a bit annoying but can you either explicity test or just pass numeric_only=False
?
pandas/core/groupby/groupby.py
Outdated
libgroupby.group_var, | ||
cython_dtype=np.dtype(np.float64), | ||
numeric_only=numeric_only, | ||
needs_counts=True, | ||
post_processing=lambda vals, inference: np.sqrt(vals), | ||
ddof=ddof, | ||
) | ||
if ( | ||
self.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.
can you make a helper for this rather than repeating?
@@ -81,6 +81,7 @@ def get_stats(group): | |||
assert result.index.names[0] == "C" | |||
|
|||
|
|||
@pytest.mark.filterwarnings("ignore:.*value of numeric_only.*:FutureWarning") |
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.
can you explictily test these rather than filtering (alt pass numeric_only=False
) as needed
Thanks @jreback; filterwarnings has been removed and the helper had been added. |
very nice @rhshadrach |
I think this causes the doc build to fail with multiple of these warnings:
Would probably need to update the documentation to avoid these FutureWarnings. |
Thanks @twoertwein - will do a follow up. |
* TYP: NoDefault * ix mypy issues; re-write isinstance(..., NoDefault) * remove two more casts * ENH: DatetimeArray fields support non-nano (#47044) * DEPR: groupby numeric_only default (#47025) * DOC: Clarify decay argument validation in ewm when times is provided (#47026) * DOC: Fix some typos in pandas/. (#47022) * remove two more casts * avoid cast-like annotation * left/right * cannot use | Co-authored-by: jbrockmendel <jbrockmendel@gmail.com> Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com> Co-authored-by: Matthew Roeschke <emailformattr@gmail.com> Co-authored-by: Shuangchi He <34329208+Yulv-git@users.noreply.github.com>
* TYP: NoDefault * ix mypy issues; re-write isinstance(..., NoDefault) * remove two more casts * ENH: DatetimeArray fields support non-nano (pandas-dev#47044) * DEPR: groupby numeric_only default (pandas-dev#47025) * DOC: Clarify decay argument validation in ewm when times is provided (pandas-dev#47026) * DOC: Fix some typos in pandas/. (pandas-dev#47022) * remove two more casts * avoid cast-like annotation * left/right * cannot use | Co-authored-by: jbrockmendel <jbrockmendel@gmail.com> Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com> Co-authored-by: Matthew Roeschke <emailformattr@gmail.com> Co-authored-by: Shuangchi He <34329208+Yulv-git@users.noreply.github.com>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.There are two cases we want to emit a deprecation warning for DataFrameGroupBy: