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

DOC : Delete args and kwargs from pandas.Grouper #58397

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Expand Up @@ -116,7 +116,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DatetimeIndex.tz_convert RT03" \
-i "pandas.DatetimeTZDtype SA01" \
-i "pandas.DatetimeTZDtype.tz SA01" \
-i "pandas.Grouper PR02" \
-i "pandas.Index PR07" \
-i "pandas.Index.T SA01" \
-i "pandas.Index.append PR07,RT03,SA01" \
Expand Down
19 changes: 13 additions & 6 deletions pandas/core/groupby/grouper.py
Expand Up @@ -67,10 +67,6 @@ class Grouper:

Parameters
----------
*args
Currently unused, reserved for future use.
**kwargs
Dictionary of the keyword arguments to pass to Grouper.
key : str, defaults to None
Groupby key, which selects the grouping column of the target.
level : name/number, defaults to None
Expand Down Expand Up @@ -247,8 +243,19 @@ class Grouper:

_attributes: tuple[str, ...] = ("key", "level", "freq", "sort", "dropna")

def __new__(cls, *args, **kwargs):
if kwargs.get("freq") is not None:
def __new__(
cls,
key=None,
level=None,
freq=None,
sort: bool = False,
closed='left',
label='left',
convention='start',
origin='start_day',
offset=None,
dropna: bool = True,):
if freq is not None:
from pandas.core.resample import TimeGrouper

cls = TimeGrouper
Expand Down