File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1012,7 +1012,7 @@ def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]:
1012
1012
# mypy: Argument 1 to "len" has incompatible type "Hashable"; expected "Sized"
1013
1013
if (
1014
1014
(is_list_like (level ) and len (level ) == 1 ) # type: ignore[arg-type]
1015
- or (isinstance (keys , list ) and len ( keys ) == 1 )
1015
+ or (isinstance (keys , list ))
1016
1016
):
1017
1017
# GH#42795 - when keys is a list, return tuples even when length is 1
1018
1018
result = (((key ,), group ) for key , group in result )
Original file line number Diff line number Diff line change @@ -703,7 +703,7 @@ def size(self) -> Series:
703
703
@cache_readonly
704
704
def groups (self ) -> dict [Hashable , Index ]:
705
705
"""dict {group name -> group labels}"""
706
- if len (self .groupings ) == 1 :
706
+ if len (self .groupings ) == 1 and not isinstance ( self . shape , tuple ) :
707
707
return self .groupings [0 ].groups
708
708
result_index , ids = self .result_index_and_ids
709
709
values = result_index ._values
You can’t perform that action at this time.
0 commit comments