index.pyi 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import numpy as np
  2. class IndexEngine:
  3. over_size_threshold: bool
  4. def __init__(self, vgetter, n: int): ...
  5. def __contains__(self, val: object) -> bool: ...
  6. # -> int | slice | np.ndarray[bool]
  7. def get_loc(self, val: object) -> int | slice | np.ndarray: ...
  8. def sizeof(self, deep: bool = False) -> int: ...
  9. def __sizeof__(self) -> int: ...
  10. @property
  11. def is_unique(self) -> bool: ...
  12. @property
  13. def is_monotonic_increasing(self) -> bool: ...
  14. @property
  15. def is_monotonic_decreasing(self) -> bool: ...
  16. def get_backfill_indexer(
  17. self, other: np.ndarray, limit: int | None = ...
  18. ) -> np.ndarray: ...
  19. def get_pad_indexer(
  20. self, other: np.ndarray, limit: int | None = ...
  21. ) -> np.ndarray: ...
  22. @property
  23. def is_mapping_populated(self) -> bool: ...
  24. def clear_mapping(self): ...
  25. def get_indexer(self, values: np.ndarray) -> np.ndarray: ... # np.ndarray[np.intp]
  26. def get_indexer_non_unique(
  27. self,
  28. targets: np.ndarray,
  29. ) -> tuple[
  30. np.ndarray, # np.ndarray[np.intp]
  31. np.ndarray, # np.ndarray[np.intp]
  32. ]: ...
  33. class Float64Engine(IndexEngine): ...
  34. class Float32Engine(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 BaseMultiIndexCodesEngine:
  48. levels: list[np.ndarray]
  49. offsets: np.ndarray # ndarray[uint64_t, ndim=1]
  50. def __init__(
  51. self,
  52. levels: list[np.ndarray], # all entries hashable
  53. labels: list[np.ndarray], # all entries integer-dtyped
  54. offsets: np.ndarray, # np.ndarray[np.uint64, ndim=1]
  55. ): ...
  56. def get_indexer(
  57. self,
  58. target: np.ndarray, # np.ndarray[object]
  59. ) -> np.ndarray: ... # np.ndarray[np.intp]
  60. def _extract_level_codes(self, target: object): ...
  61. def get_indexer_with_fill(
  62. self,
  63. target: np.ndarray, # np.ndarray[object] of tuples
  64. values: np.ndarray, # np.ndarray[object] of tuples
  65. method: str,
  66. limit: int | None,
  67. ) -> np.ndarray: ... # np.ndarray[np.int64]