Skip to content

Commit cdd9d36

Browse files
committed
from_product
1 parent ca848bb commit cdd9d36

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

pandas/core/generic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,9 @@ def _rename(
10501050
return result.__finalize__(self, method="rename")
10511051

10521052
@rewrite_axis_style_signature("mapper", [("copy", True), ("inplace", False)])
1053-
def rename_axis(self, mapper: IndexLabel = lib.no_default, **kwargs):
1053+
def rename_axis(
1054+
self, mapper: IndexLabel | lib.NoDefault = lib.no_default, **kwargs
1055+
):
10541056
"""
10551057
Set the name of the axis for the index or columns.
10561058

pandas/core/groupby/groupby.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4050,12 +4050,7 @@ def _reindex_output(
40504050
# "ndarray[Any, dtype[floating[_64Bit]]]"; expected "Index"
40514051
levels_list.append(qs) # type: ignore[arg-type]
40524052
names = names + [None]
4053-
# error: Argument "names" to "from_product" of "MultiIndex" has
4054-
# incompatible type "List[Hashable]"; expected "Union[Sequence[
4055-
# Optional[str]], Literal[_NoDefault.no_default]]"
4056-
index, _ = MultiIndex.from_product(
4057-
levels_list, names=names # type: ignore[arg-type]
4058-
).sortlevel()
4053+
index, _ = MultiIndex.from_product(levels_list, names=names).sortlevel()
40594054

40604055
if self.as_index:
40614056
# Always holds for SeriesGroupBy unless GH#36507 is implemented

pandas/core/indexes/multi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def from_product(
581581
cls,
582582
iterables: Sequence[Iterable[Hashable]],
583583
sortorder: int | None = None,
584-
names: Sequence[str | None] | lib.NoDefault = lib.no_default,
584+
names: Sequence[Hashable] | lib.NoDefault = lib.no_default,
585585
) -> MultiIndex:
586586
"""
587587
Make a MultiIndex from the cartesian product of multiple iterables.

0 commit comments

Comments
 (0)