groupby.pyi 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. from typing import Literal
  2. import numpy as np
  3. from pandas._typing import npt
  4. def group_median_float64(
  5. out: np.ndarray, # ndarray[float64_t, ndim=2]
  6. counts: npt.NDArray[np.int64],
  7. values: np.ndarray, # ndarray[float64_t, ndim=2]
  8. labels: npt.NDArray[np.int64],
  9. min_count: int = ..., # Py_ssize_t
  10. mask: np.ndarray | None = ...,
  11. result_mask: np.ndarray | None = ...,
  12. ) -> None: ...
  13. def group_cumprod(
  14. out: np.ndarray, # float64_t[:, ::1]
  15. values: np.ndarray, # const float64_t[:, :]
  16. labels: np.ndarray, # const int64_t[:]
  17. ngroups: int,
  18. is_datetimelike: bool,
  19. skipna: bool = ...,
  20. mask: np.ndarray | None = ...,
  21. result_mask: np.ndarray | None = ...,
  22. ) -> None: ...
  23. def group_cumsum(
  24. out: np.ndarray, # int64float_t[:, ::1]
  25. values: np.ndarray, # ndarray[int64float_t, ndim=2]
  26. labels: np.ndarray, # const int64_t[:]
  27. ngroups: int,
  28. is_datetimelike: bool,
  29. skipna: bool = ...,
  30. mask: np.ndarray | None = ...,
  31. result_mask: np.ndarray | None = ...,
  32. ) -> None: ...
  33. def group_shift_indexer(
  34. out: np.ndarray, # int64_t[::1]
  35. labels: np.ndarray, # const int64_t[:]
  36. ngroups: int,
  37. periods: int,
  38. ) -> None: ...
  39. def group_fillna_indexer(
  40. out: np.ndarray, # ndarray[intp_t]
  41. labels: np.ndarray, # ndarray[int64_t]
  42. sorted_labels: npt.NDArray[np.intp],
  43. mask: npt.NDArray[np.uint8],
  44. direction: Literal["ffill", "bfill"],
  45. limit: int, # int64_t
  46. dropna: bool,
  47. ) -> None: ...
  48. def group_any_all(
  49. out: np.ndarray, # uint8_t[::1]
  50. values: np.ndarray, # const uint8_t[::1]
  51. labels: np.ndarray, # const int64_t[:]
  52. mask: np.ndarray, # const uint8_t[::1]
  53. val_test: Literal["any", "all"],
  54. skipna: bool,
  55. nullable: bool,
  56. ) -> None: ...
  57. def group_sum(
  58. out: np.ndarray, # complexfloatingintuint_t[:, ::1]
  59. counts: np.ndarray, # int64_t[::1]
  60. values: np.ndarray, # ndarray[complexfloatingintuint_t, ndim=2]
  61. labels: np.ndarray, # const intp_t[:]
  62. mask: np.ndarray | None,
  63. result_mask: np.ndarray | None = ...,
  64. min_count: int = ...,
  65. is_datetimelike: bool = ...,
  66. ) -> None: ...
  67. def group_prod(
  68. out: np.ndarray, # int64float_t[:, ::1]
  69. counts: np.ndarray, # int64_t[::1]
  70. values: np.ndarray, # ndarray[int64float_t, ndim=2]
  71. labels: np.ndarray, # const intp_t[:]
  72. mask: np.ndarray | None,
  73. result_mask: np.ndarray | None = ...,
  74. min_count: int = ...,
  75. ) -> None: ...
  76. def group_var(
  77. out: np.ndarray, # floating[:, ::1]
  78. counts: np.ndarray, # int64_t[::1]
  79. values: np.ndarray, # ndarray[floating, ndim=2]
  80. labels: np.ndarray, # const intp_t[:]
  81. min_count: int = ..., # Py_ssize_t
  82. ddof: int = ..., # int64_t
  83. mask: np.ndarray | None = ...,
  84. result_mask: np.ndarray | None = ...,
  85. is_datetimelike: bool = ...,
  86. ) -> None: ...
  87. def group_mean(
  88. out: np.ndarray, # floating[:, ::1]
  89. counts: np.ndarray, # int64_t[::1]
  90. values: np.ndarray, # ndarray[floating, ndim=2]
  91. labels: np.ndarray, # const intp_t[:]
  92. min_count: int = ..., # Py_ssize_t
  93. is_datetimelike: bool = ..., # bint
  94. mask: np.ndarray | None = ...,
  95. result_mask: np.ndarray | None = ...,
  96. ) -> None: ...
  97. def group_ohlc(
  98. out: np.ndarray, # floatingintuint_t[:, ::1]
  99. counts: np.ndarray, # int64_t[::1]
  100. values: np.ndarray, # ndarray[floatingintuint_t, ndim=2]
  101. labels: np.ndarray, # const intp_t[:]
  102. min_count: int = ...,
  103. mask: np.ndarray | None = ...,
  104. result_mask: np.ndarray | None = ...,
  105. ) -> None: ...
  106. def group_quantile(
  107. out: npt.NDArray[np.float64],
  108. values: np.ndarray, # ndarray[numeric, ndim=1]
  109. labels: npt.NDArray[np.intp],
  110. mask: npt.NDArray[np.uint8],
  111. sort_indexer: npt.NDArray[np.intp], # const
  112. qs: npt.NDArray[np.float64], # const
  113. interpolation: Literal["linear", "lower", "higher", "nearest", "midpoint"],
  114. result_mask: np.ndarray | None = ...,
  115. ) -> None: ...
  116. def group_last(
  117. out: np.ndarray, # rank_t[:, ::1]
  118. counts: np.ndarray, # int64_t[::1]
  119. values: np.ndarray, # ndarray[rank_t, ndim=2]
  120. labels: np.ndarray, # const int64_t[:]
  121. mask: npt.NDArray[np.bool_] | None,
  122. result_mask: npt.NDArray[np.bool_] | None = ...,
  123. min_count: int = ..., # Py_ssize_t
  124. is_datetimelike: bool = ...,
  125. ) -> None: ...
  126. def group_nth(
  127. out: np.ndarray, # rank_t[:, ::1]
  128. counts: np.ndarray, # int64_t[::1]
  129. values: np.ndarray, # ndarray[rank_t, ndim=2]
  130. labels: np.ndarray, # const int64_t[:]
  131. mask: npt.NDArray[np.bool_] | None,
  132. result_mask: npt.NDArray[np.bool_] | None = ...,
  133. min_count: int = ..., # int64_t
  134. rank: int = ..., # int64_t
  135. is_datetimelike: bool = ...,
  136. ) -> None: ...
  137. def group_rank(
  138. out: np.ndarray, # float64_t[:, ::1]
  139. values: np.ndarray, # ndarray[rank_t, ndim=2]
  140. labels: np.ndarray, # const int64_t[:]
  141. ngroups: int,
  142. is_datetimelike: bool,
  143. ties_method: Literal["average", "min", "max", "first", "dense"] = ...,
  144. ascending: bool = ...,
  145. pct: bool = ...,
  146. na_option: Literal["keep", "top", "bottom"] = ...,
  147. mask: npt.NDArray[np.bool_] | None = ...,
  148. ) -> None: ...
  149. def group_max(
  150. out: np.ndarray, # groupby_t[:, ::1]
  151. counts: np.ndarray, # int64_t[::1]
  152. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  153. labels: np.ndarray, # const int64_t[:]
  154. min_count: int = ...,
  155. is_datetimelike: bool = ...,
  156. mask: np.ndarray | None = ...,
  157. result_mask: np.ndarray | None = ...,
  158. ) -> None: ...
  159. def group_min(
  160. out: np.ndarray, # groupby_t[:, ::1]
  161. counts: np.ndarray, # int64_t[::1]
  162. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  163. labels: np.ndarray, # const int64_t[:]
  164. min_count: int = ...,
  165. is_datetimelike: bool = ...,
  166. mask: np.ndarray | None = ...,
  167. result_mask: np.ndarray | None = ...,
  168. ) -> None: ...
  169. def group_cummin(
  170. out: np.ndarray, # groupby_t[:, ::1]
  171. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  172. labels: np.ndarray, # const int64_t[:]
  173. ngroups: int,
  174. is_datetimelike: bool,
  175. mask: np.ndarray | None = ...,
  176. result_mask: np.ndarray | None = ...,
  177. skipna: bool = ...,
  178. ) -> None: ...
  179. def group_cummax(
  180. out: np.ndarray, # groupby_t[:, ::1]
  181. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  182. labels: np.ndarray, # const int64_t[:]
  183. ngroups: int,
  184. is_datetimelike: bool,
  185. mask: np.ndarray | None = ...,
  186. result_mask: np.ndarray | None = ...,
  187. skipna: bool = ...,
  188. ) -> None: ...