/ lib / pandas / _libs / index.pyi
index.pyi
 1  import numpy as np
 2  
 3  from pandas._typing import npt
 4  
 5  from pandas import MultiIndex
 6  from pandas.core.arrays import ExtensionArray
 7  
 8  class IndexEngine:
 9      over_size_threshold: bool
10      def __init__(self, values: np.ndarray): ...
11      def __contains__(self, val: object) -> bool: ...
12      # -> int | slice | np.ndarray[bool]
13      def get_loc(self, val: object) -> int | slice | np.ndarray: ...
14      def sizeof(self, deep: bool = ...) -> int: ...
15      def __sizeof__(self) -> int: ...
16      @property
17      def is_unique(self) -> bool: ...
18      @property
19      def is_monotonic_increasing(self) -> bool: ...
20      @property
21      def is_monotonic_decreasing(self) -> bool: ...
22      @property
23      def is_mapping_populated(self) -> bool: ...
24      def clear_mapping(self): ...
25      def get_indexer(self, values: np.ndarray) -> npt.NDArray[np.intp]: ...
26      def get_indexer_non_unique(
27          self,
28          targets: np.ndarray,
29      ) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
30  
31  class Float64Engine(IndexEngine): ...
32  class Float32Engine(IndexEngine): ...
33  class Complex128Engine(IndexEngine): ...
34  class Complex64Engine(IndexEngine): ...
35  class Int64Engine(IndexEngine): ...
36  class Int32Engine(IndexEngine): ...
37  class Int16Engine(IndexEngine): ...
38  class Int8Engine(IndexEngine): ...
39  class UInt64Engine(IndexEngine): ...
40  class UInt32Engine(IndexEngine): ...
41  class UInt16Engine(IndexEngine): ...
42  class UInt8Engine(IndexEngine): ...
43  class ObjectEngine(IndexEngine): ...
44  class DatetimeEngine(Int64Engine): ...
45  class TimedeltaEngine(DatetimeEngine): ...
46  class PeriodEngine(Int64Engine): ...
47  class BoolEngine(UInt8Engine): ...
48  
49  class BaseMultiIndexCodesEngine:
50      levels: list[np.ndarray]
51      offsets: np.ndarray  # ndarray[uint64_t, ndim=1]
52      def __init__(
53          self,
54          levels: list[np.ndarray],  # all entries hashable
55          labels: list[np.ndarray],  # all entries integer-dtyped
56          offsets: np.ndarray,  # np.ndarray[np.uint64, ndim=1]
57      ): ...
58      def get_indexer(
59          self,
60          target: npt.NDArray[np.object_],
61      ) -> npt.NDArray[np.intp]: ...
62      def _extract_level_codes(self, target: MultiIndex) -> np.ndarray: ...
63      def get_indexer_with_fill(
64          self,
65          target: np.ndarray,  # np.ndarray[object] of tuples
66          values: np.ndarray,  # np.ndarray[object] of tuples
67          method: str,
68          limit: int | None,
69      ) -> npt.NDArray[np.intp]: ...
70  
71  class ExtensionEngine:
72      def __init__(self, values: ExtensionArray): ...
73      def __contains__(self, val: object) -> bool: ...
74      def get_loc(self, val: object) -> int | slice | np.ndarray: ...
75      def get_indexer(self, values: np.ndarray) -> npt.NDArray[np.intp]: ...
76      def get_indexer_non_unique(
77          self,
78          targets: np.ndarray,
79      ) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
80      @property
81      def is_unique(self) -> bool: ...
82      @property
83      def is_monotonic_increasing(self) -> bool: ...
84      @property
85      def is_monotonic_decreasing(self) -> bool: ...
86      def sizeof(self, deep: bool = ...) -> int: ...
87      def clear_mapping(self): ...