|
1 | 1 | from __future__ import annotations
|
2 | 2 |
|
3 |
| -from collections.abc import ( |
| 3 | +from typing import ( |
| 4 | + TYPE_CHECKING, |
| 5 | + Any, |
4 | 6 | Callable,
|
5 | 7 | Collection,
|
6 |
| - Generator, |
7 | 8 | Hashable,
|
8 | 9 | Iterable,
|
9 |
| - Mapping, |
10 |
| - Sequence, |
| 10 | + Iterator, |
11 | 11 | List,
|
12 |
| -) |
13 |
| -from functools import wraps |
14 |
| -from sys import getsizeof |
15 |
| -from typing import ( |
16 |
| - TYPE_CHECKING, |
17 |
| - Any, |
18 | 12 | Literal,
|
| 13 | + Mapping, |
| 14 | + Sequence, |
19 | 15 | cast,
|
20 |
| - ArrayLike, |
| 16 | + overload, |
21 | 17 | )
|
22 |
| -import warnings |
23 | 18 |
|
24 | 19 | import numpy as np
|
25 | 20 |
|
26 |
| -from pandas._config import get_option |
27 |
| - |
28 |
| -from pandas._libs import ( |
29 |
| - algos as libalgos, |
30 |
| - index as libindex, |
31 |
| - lib, |
32 |
| -) |
33 |
| -from pandas._libs.hashtable import duplicated |
| 21 | +from pandas._libs import lib |
| 22 | +from pandas._libs.hashtable import duplicated_int64 |
34 | 23 | from pandas._typing import (
|
35 |
| - AnyAll, |
36 |
| - AnyArrayLike, |
| 24 | + ArrayLike, |
37 | 25 | Axis,
|
38 |
| - DropKeep, |
39 | 26 | DtypeObj,
|
40 | 27 | F,
|
41 |
| - IgnoreRaise, |
42 |
| - IndexLabel, |
43 |
| - IndexT, |
44 |
| - Scalar, |
45 |
| - Self, |
46 | 28 | Shape,
|
47 | 29 | npt,
|
48 | 30 | )
|
49 |
| -from pandas.compat.numpy import function as nv |
50 |
| -from pandas.errors import ( |
51 |
| - InvalidIndexError, |
52 |
| - PerformanceWarning, |
53 |
| - UnsortedIndexError, |
54 |
| -) |
| 31 | +from pandas.errors import InvalidIndexError |
55 | 32 | from pandas.util._decorators import (
|
56 |
| - Appender, |
57 | 33 | cache_readonly,
|
58 | 34 | doc,
|
59 |
| - set_module, |
60 | 35 | )
|
61 | 36 | from pandas.util._exceptions import find_stack_level
|
62 | 37 |
|
63 | 38 | from pandas.core.dtypes.cast import coerce_indexer_dtype
|
64 | 39 | from pandas.core.dtypes.common import (
|
65 | 40 | ensure_int64,
|
66 | 41 | ensure_platform_int,
|
67 |
| - is_hashable, |
68 |
| - is_integer, |
69 |
| - is_iterator, |
| 42 | + is_categorical_dtype, |
| 43 | + is_extension_array_dtype, |
70 | 44 | is_list_like,
|
71 | 45 | is_object_dtype,
|
72 |
| - is_scalar, |
73 |
| - is_string_dtype, |
74 | 46 | pandas_dtype,
|
75 | 47 | )
|
76 |
| -from pandas.core.dtypes.dtypes import ( |
77 |
| - CategoricalDtype, |
78 |
| - ExtensionDtype, |
79 |
| -) |
80 |
| -from pandas.core.dtypes.generic import ( |
81 |
| - ABCDataFrame, |
82 |
| - ABCSeries, |
83 |
| -) |
84 |
| -from pandas.core.dtypes.inference import is_array_like |
85 |
| -from pandas.core.dtypes.missing import ( |
86 |
| - array_equivalent, |
87 |
| - isna, |
88 |
| -) |
| 48 | +from pandas.core.dtypes.dtypes import ExtensionDtype |
| 49 | +from pandas.core.dtypes.missing import array_equivalent, isna |
89 | 50 |
|
90 | 51 | import pandas.core.algorithms as algos
|
91 |
| -from pandas.core.array_algos.putmask import validate_putmask |
92 |
| -from pandas.core.arrays import ( |
93 |
| - Categorical, |
94 |
| - ExtensionArray, |
95 |
| -) |
96 |
| -from pandas.core.arrays.categorical import ( |
97 |
| - factorize_from_iterables, |
98 |
| - recode_for_categories, |
99 |
| -) |
100 |
| -import pandas.core.common as com |
101 |
| -from pandas.core.construction import sanitize_array |
102 |
| -import pandas.core.indexes.base as ibase |
| 52 | +from pandas.core.arrays.categorical import Categorical |
103 | 53 | from pandas.core.indexes.base import (
|
104 | 54 | Index,
|
105 | 55 | _index_shared_docs,
|
106 | 56 | ensure_index,
|
107 | 57 | get_unanimous_names,
|
108 | 58 | )
|
109 | 59 | from pandas.core.indexes.frozen import FrozenList
|
110 |
| -from pandas.core.ops.invalid import make_invalid_op |
111 |
| -from pandas.core.sorting import ( |
112 |
| - get_group_index, |
113 |
| - lexsort_indexer, |
114 |
| -) |
115 |
| - |
116 |
| -from pandas.io.formats.printing import pprint_thing |
117 | 60 |
|
118 | 61 | if TYPE_CHECKING:
|
119 |
| - from pandas import ( |
120 |
| - CategoricalIndex, |
121 |
| - DataFrame, |
122 |
| - Series, |
123 |
| - ) |
| 62 | + from pandas import DataFrame |
124 | 63 |
|
125 | 64 | _index_doc_kwargs = dict(ibase._index_doc_kwargs)
|
126 | 65 | _index_doc_kwargs.update(
|
|
0 commit comments