From 4080f8bb7f8a49d646dfcc06b6d86061a2f48551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Thu, 30 Jun 2022 22:10:04 -0400 Subject: [PATCH] TYP: fix type of level in DataFrame.groupby --- pandas/_typing.py | 2 +- pandas/core/frame.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_typing.py b/pandas/_typing.py index a1bb119c32ba6..ac1237f8841be 100644 --- a/pandas/_typing.py +++ b/pandas/_typing.py @@ -109,7 +109,7 @@ Axis = Union[str, int] IndexLabel = Union[Hashable, Sequence[Hashable]] -Level = Union[Hashable, int] +Level = Hashable Shape = Tuple[int, ...] Suffixes = Tuple[Optional[str], Optional[str]] Ordered = Optional[bool] diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 0a255fdd49590..82ae93ad31763 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8125,7 +8125,7 @@ def groupby( self, by=None, axis: Axis = 0, - level: Level | None = None, + level: IndexLabel | None = None, as_index: bool = True, sort: bool = True, group_keys: bool | lib.NoDefault = no_default,