index.pyi 3.8 KB

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