Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 0 additions & 16 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: Scalar,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1160,7 +1159,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: Scalar,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1172,7 +1170,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: DatetimeIndex,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1184,7 +1181,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: DatetimeIndex,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1196,7 +1192,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: TimedeltaIndex,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1208,7 +1203,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: TimedeltaIndex,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1220,7 +1214,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: PeriodIndex,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1232,7 +1225,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: PeriodIndex,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1244,7 +1236,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: IntervalIndex[IntervalT],
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1256,7 +1247,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: IntervalIndex[IntervalT],
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1268,7 +1258,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # type: ignore[overload-overlap] # pyright: ignore reportOverlappingOverload
self,
by: MultiIndex | GroupByObjectNonScalar | None = ...,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1280,7 +1269,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # type: ignore[overload-overlap]
self,
by: MultiIndex | GroupByObjectNonScalar | None = ...,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1292,7 +1280,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby( # pyright: ignore reportOverlappingOverload
self,
by: Series[SeriesByT],
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1304,7 +1291,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: Series[SeriesByT],
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand All @@ -1316,7 +1302,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: CategoricalIndex | Index | Series,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[True] = True,
sort: _bool = ...,
Expand All @@ -1328,7 +1313,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
def groupby(
self,
by: CategoricalIndex | Index | Series,
axis: AxisIndex | _NoDefaultDoNotUse = ...,
level: IndexLabel | None = ...,
as_index: Literal[False] = ...,
sort: _bool = ...,
Expand Down
10 changes: 0 additions & 10 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: Scalar,
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -638,7 +637,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: DatetimeIndex,
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -650,7 +648,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: TimedeltaIndex,
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -662,7 +659,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: PeriodIndex,
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -674,7 +670,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: IntervalIndex[IntervalT],
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -686,7 +681,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: MultiIndex | GroupByObjectNonScalar,
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -698,7 +692,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: None,
axis: AxisIndex,
level: IndexLabel, # level is required when by=None (passed as positional)
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -710,7 +703,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: None = ...,
axis: AxisIndex = ...,
*,
level: IndexLabel, # level is required when by=None (passed as keyword)
as_index: _bool = ...,
Expand All @@ -723,7 +715,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: Series[SeriesByT],
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand All @@ -735,7 +726,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
def groupby(
self,
by: CategoricalIndex | Index | Series,
axis: AxisIndex = ...,
level: IndexLabel | None = ...,
as_index: _bool = ...,
sort: _bool = ...,
Expand Down
6 changes: 0 additions & 6 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,6 @@ def test_types_mean() -> None:
assert_type(df.mean(axis=1, skipna=True, numeric_only=False), pd.Series),
pd.Series,
)
if TYPE_CHECKING_INVALID_USAGE:
df3: pd.DataFrame = df.groupby(axis=1, level=0).mean() # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue]
df4: pd.DataFrame = df.groupby(axis=1, level=0, dropna=True).mean() # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue]


def test_types_median() -> None:
Expand All @@ -702,9 +699,6 @@ def test_types_median() -> None:
assert_type(df.median(axis=1, skipna=True, numeric_only=False), pd.Series),
pd.Series,
)
if TYPE_CHECKING_INVALID_USAGE:
df3: pd.DataFrame = df.groupby(axis=1, level=0).median() # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue]
df4: pd.DataFrame = df.groupby(axis=1, level=0, dropna=True).median() # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue]


def test_types_iterrows() -> None:
Expand Down
Loading