1
1
from collections .abc import (
2
2
Callable ,
3
3
Hashable ,
4
+ Iterable ,
4
5
Sequence ,
5
6
)
6
7
from typing import (
@@ -16,6 +17,7 @@ from pandas.core.indexes.base import Index
16
17
from typing_extensions import Self
17
18
18
19
from pandas ._typing import (
20
+ AnyArrayLike ,
19
21
Dtype ,
20
22
DtypeArg ,
21
23
HashableT ,
@@ -27,31 +29,42 @@ from pandas._typing import (
27
29
class MultiIndex (Index [Any ]):
28
30
def __new__ (
29
31
cls ,
30
- levels = ...,
31
- codes = ...,
32
- sortorder = ...,
32
+ levels : SequenceNotStr [ SequenceNotStr [ Hashable ]] = ...,
33
+ codes : SequenceNotStr [ SequenceNotStr [ int ]] = ...,
34
+ sortorder : int | None = ...,
33
35
names : SequenceNotStr [Hashable ] = ...,
34
- dtype = ...,
35
- copy = ...,
36
+ copy : bool = ...,
36
37
name : SequenceNotStr [Hashable ] = ...,
37
38
verify_integrity : bool = ...,
38
39
_set_identity : bool = ...,
39
40
) -> Self : ...
40
41
@classmethod
41
42
def from_arrays (
42
- cls , arrays , sortorder = ..., names : SequenceNotStr [Hashable ] = ...
43
+ cls ,
44
+ arrays : SequenceNotStr [SequenceNotStr [Hashable ]] | SequenceNotStr [AnyArrayLike ],
45
+ sortorder : int | None = ...,
46
+ names : SequenceNotStr [Hashable ] = ...,
43
47
) -> Self : ...
44
48
@classmethod
45
49
def from_tuples (
46
- cls , tuples , sortorder = ..., names : SequenceNotStr [Hashable ] = ...
50
+ cls ,
51
+ tuples : Iterable [tuple [Hashable , ...]],
52
+ sortorder : int | None = ...,
53
+ names : SequenceNotStr [Hashable ] = ...,
47
54
) -> Self : ...
48
55
@classmethod
49
56
def from_product (
50
- cls , iterables , sortorder = ..., names : SequenceNotStr [Hashable ] = ...
57
+ cls ,
58
+ iterables : SequenceNotStr [Iterable [Hashable ]],
59
+ sortorder : int | None = ...,
60
+ names : SequenceNotStr [Hashable ] = ...,
51
61
) -> Self : ...
52
62
@classmethod
53
63
def from_frame (
54
- cls , df , sortorder = ..., names : SequenceNotStr [Hashable ] = ...
64
+ cls ,
65
+ df : pd .DataFrame ,
66
+ sortorder : int | None = ...,
67
+ names : SequenceNotStr [Hashable ] = ...,
55
68
) -> Self : ...
56
69
@property
57
70
def shape (self ): ...
0 commit comments