groupby.pyi 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. limit: int, # int64_t
  45. dropna: bool,
  46. ) -> None: ...
  47. def group_any_all(
  48. out: np.ndarray, # uint8_t[::1]
  49. values: np.ndarray, # const uint8_t[::1]
  50. labels: np.ndarray, # const int64_t[:]
  51. mask: np.ndarray, # const uint8_t[::1]
  52. val_test: Literal["any", "all"],
  53. skipna: bool,
  54. result_mask: np.ndarray | None,
  55. ) -> None: ...
  56. def group_sum(
  57. out: np.ndarray, # complexfloatingintuint_t[:, ::1]
  58. counts: np.ndarray, # int64_t[::1]
  59. values: np.ndarray, # ndarray[complexfloatingintuint_t, ndim=2]
  60. labels: np.ndarray, # const intp_t[:]
  61. mask: np.ndarray | None,
  62. result_mask: np.ndarray | None = ...,
  63. min_count: int = ...,
  64. is_datetimelike: bool = ...,
  65. initial: object = ...,
  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. name: str = ...,
  87. ) -> None: ...
  88. def group_skew(
  89. out: np.ndarray, # float64_t[:, ::1]
  90. counts: np.ndarray, # int64_t[::1]
  91. values: np.ndarray, # ndarray[float64_T, ndim=2]
  92. labels: np.ndarray, # const intp_t[::1]
  93. mask: np.ndarray | None = ...,
  94. result_mask: np.ndarray | None = ...,
  95. skipna: bool = ...,
  96. ) -> None: ...
  97. def group_mean(
  98. out: np.ndarray, # floating[:, ::1]
  99. counts: np.ndarray, # int64_t[::1]
  100. values: np.ndarray, # ndarray[floating, ndim=2]
  101. labels: np.ndarray, # const intp_t[:]
  102. min_count: int = ..., # Py_ssize_t
  103. is_datetimelike: bool = ..., # bint
  104. mask: np.ndarray | None = ...,
  105. result_mask: np.ndarray | None = ...,
  106. ) -> None: ...
  107. def group_ohlc(
  108. out: np.ndarray, # floatingintuint_t[:, ::1]
  109. counts: np.ndarray, # int64_t[::1]
  110. values: np.ndarray, # ndarray[floatingintuint_t, ndim=2]
  111. labels: np.ndarray, # const intp_t[:]
  112. min_count: int = ...,
  113. mask: np.ndarray | None = ...,
  114. result_mask: np.ndarray | None = ...,
  115. ) -> None: ...
  116. def group_quantile(
  117. out: npt.NDArray[np.float64],
  118. values: np.ndarray, # ndarray[numeric, ndim=1]
  119. labels: npt.NDArray[np.intp],
  120. mask: npt.NDArray[np.uint8],
  121. qs: npt.NDArray[np.float64], # const
  122. starts: npt.NDArray[np.int64],
  123. ends: npt.NDArray[np.int64],
  124. interpolation: Literal["linear", "lower", "higher", "nearest", "midpoint"],
  125. result_mask: np.ndarray | None,
  126. is_datetimelike: bool,
  127. ) -> None: ...
  128. def group_last(
  129. out: np.ndarray, # rank_t[:, ::1]
  130. counts: np.ndarray, # int64_t[::1]
  131. values: np.ndarray, # ndarray[rank_t, ndim=2]
  132. labels: np.ndarray, # const int64_t[:]
  133. mask: npt.NDArray[np.bool_] | None,
  134. result_mask: npt.NDArray[np.bool_] | None = ...,
  135. min_count: int = ..., # Py_ssize_t
  136. is_datetimelike: bool = ...,
  137. skipna: bool = ...,
  138. ) -> None: ...
  139. def group_nth(
  140. out: np.ndarray, # rank_t[:, ::1]
  141. counts: np.ndarray, # int64_t[::1]
  142. values: np.ndarray, # ndarray[rank_t, ndim=2]
  143. labels: np.ndarray, # const int64_t[:]
  144. mask: npt.NDArray[np.bool_] | None,
  145. result_mask: npt.NDArray[np.bool_] | None = ...,
  146. min_count: int = ..., # int64_t
  147. rank: int = ..., # int64_t
  148. is_datetimelike: bool = ...,
  149. skipna: bool = ...,
  150. ) -> None: ...
  151. def group_rank(
  152. out: np.ndarray, # float64_t[:, ::1]
  153. values: np.ndarray, # ndarray[rank_t, ndim=2]
  154. labels: np.ndarray, # const int64_t[:]
  155. ngroups: int,
  156. is_datetimelike: bool,
  157. ties_method: Literal["average", "min", "max", "first", "dense"] = ...,
  158. ascending: bool = ...,
  159. pct: bool = ...,
  160. na_option: Literal["keep", "top", "bottom"] = ...,
  161. mask: npt.NDArray[np.bool_] | None = ...,
  162. ) -> None: ...
  163. def group_max(
  164. out: np.ndarray, # groupby_t[:, ::1]
  165. counts: np.ndarray, # int64_t[::1]
  166. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  167. labels: np.ndarray, # const int64_t[:]
  168. min_count: int = ...,
  169. is_datetimelike: bool = ...,
  170. mask: np.ndarray | None = ...,
  171. result_mask: np.ndarray | None = ...,
  172. ) -> None: ...
  173. def group_min(
  174. out: np.ndarray, # groupby_t[:, ::1]
  175. counts: np.ndarray, # int64_t[::1]
  176. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  177. labels: np.ndarray, # const int64_t[:]
  178. min_count: int = ...,
  179. is_datetimelike: bool = ...,
  180. mask: np.ndarray | None = ...,
  181. result_mask: np.ndarray | None = ...,
  182. ) -> None: ...
  183. def group_idxmin_idxmax(
  184. out: npt.NDArray[np.intp],
  185. counts: npt.NDArray[np.int64],
  186. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  187. labels: npt.NDArray[np.intp],
  188. min_count: int = ...,
  189. is_datetimelike: bool = ...,
  190. mask: np.ndarray | None = ...,
  191. name: str = ...,
  192. skipna: bool = ...,
  193. result_mask: np.ndarray | None = ...,
  194. ) -> None: ...
  195. def group_cummin(
  196. out: np.ndarray, # groupby_t[:, ::1]
  197. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  198. labels: np.ndarray, # const int64_t[:]
  199. ngroups: int,
  200. is_datetimelike: bool,
  201. mask: np.ndarray | None = ...,
  202. result_mask: np.ndarray | None = ...,
  203. skipna: bool = ...,
  204. ) -> None: ...
  205. def group_cummax(
  206. out: np.ndarray, # groupby_t[:, ::1]
  207. values: np.ndarray, # ndarray[groupby_t, ndim=2]
  208. labels: np.ndarray, # const int64_t[:]
  209. ngroups: int,
  210. is_datetimelike: bool,
  211. mask: np.ndarray | None = ...,
  212. result_mask: np.ndarray | None = ...,
  213. skipna: bool = ...,
  214. ) -> None: ...