algos.pyi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. # Note: this covers algos.pyx and algos_common_helper but NOT algos_take_helper
  2. from typing import Any
  3. import numpy as np
  4. class Infinity:
  5. """
  6. Provide a positive Infinity comparison method for ranking.
  7. """
  8. def __eq__(self, other) -> bool: ...
  9. def __ne__(self, other) -> bool: ...
  10. def __lt__(self, other) -> bool: ...
  11. def __le__(self, other) -> bool: ...
  12. def __gt__(self, other) -> bool: ...
  13. def __ge__(self, other) -> bool: ...
  14. class NegInfinity:
  15. """
  16. Provide a negative Infinity comparison method for ranking.
  17. """
  18. def __eq__(self, other) -> bool: ...
  19. def __ne__(self, other) -> bool: ...
  20. def __lt__(self, other) -> bool: ...
  21. def __le__(self, other) -> bool: ...
  22. def __gt__(self, other) -> bool: ...
  23. def __ge__(self, other) -> bool: ...
  24. def unique_deltas(
  25. arr: np.ndarray, # const int64_t[:]
  26. ) -> np.ndarray: ... # np.ndarray[np.int64, ndim=1]
  27. def is_lexsorted(list_of_arrays: list[np.ndarray]) -> bool: ...
  28. def groupsort_indexer(
  29. index: np.ndarray, # const int64_t[:]
  30. ngroups: int,
  31. ) -> tuple[
  32. np.ndarray, # ndarray[int64_t, ndim=1]
  33. np.ndarray, # ndarray[int64_t, ndim=1]
  34. ]: ...
  35. def kth_smallest(
  36. a: np.ndarray, # numeric[:]
  37. k: int,
  38. ) -> Any: ... # numeric
  39. # ----------------------------------------------------------------------
  40. # Pairwise correlation/covariance
  41. def nancorr(
  42. mat: np.ndarray, # const float64_t[:, :]
  43. cov: bool = False,
  44. minp=None,
  45. ) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
  46. def nancorr_spearman(
  47. mat: np.ndarray, # ndarray[float64_t, ndim=2]
  48. minp: int = 1,
  49. ) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
  50. def nancorr_kendall(
  51. mat: np.ndarray, # ndarray[float64_t, ndim=2]
  52. minp: int = 1,
  53. ) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
  54. # ----------------------------------------------------------------------
  55. # ctypedef fused algos_t:
  56. # float64_t
  57. # float32_t
  58. # object
  59. # int64_t
  60. # int32_t
  61. # int16_t
  62. # int8_t
  63. # uint64_t
  64. # uint32_t
  65. # uint16_t
  66. # uint8_t
  67. def validate_limit(nobs: int | None, limit=None) -> int: ...
  68. def pad(
  69. old: np.ndarray, # ndarray[algos_t]
  70. new: np.ndarray, # ndarray[algos_t]
  71. limit=None,
  72. ) -> np.ndarray: ... # np.ndarray[np.intp, ndim=1]
  73. def pad_inplace(
  74. values: np.ndarray, # algos_t[:]
  75. mask: np.ndarray, # uint8_t[:]
  76. limit=None,
  77. ) -> None: ...
  78. def pad_2d_inplace(
  79. values: np.ndarray, # algos_t[:, :]
  80. mask: np.ndarray, # const uint8_t[:, :]
  81. limit=None,
  82. ) -> None: ...
  83. def backfill(
  84. old: np.ndarray, # ndarray[algos_t]
  85. new: np.ndarray, # ndarray[algos_t]
  86. limit=None,
  87. ) -> np.ndarray: ... # np.ndarray[np.intp, ndim=1]
  88. def backfill_inplace(
  89. values: np.ndarray, # algos_t[:]
  90. mask: np.ndarray, # uint8_t[:]
  91. limit=None,
  92. ) -> None: ...
  93. def backfill_2d_inplace(
  94. values: np.ndarray, # algos_t[:, :]
  95. mask: np.ndarray, # const uint8_t[:, :]
  96. limit=None,
  97. ) -> None: ...
  98. def is_monotonic(
  99. arr: np.ndarray, # ndarray[algos_t, ndim=1]
  100. timelike: bool,
  101. ) -> tuple[bool, bool, bool]: ...
  102. # ----------------------------------------------------------------------
  103. # rank_1d, rank_2d
  104. # ----------------------------------------------------------------------
  105. # ctypedef fused rank_t:
  106. # object
  107. # float64_t
  108. # uint64_t
  109. # int64_t
  110. def rank_1d(
  111. values: np.ndarray, # ndarray[rank_t, ndim=1]
  112. labels: np.ndarray, # const int64_t[:]
  113. is_datetimelike: bool = ...,
  114. ties_method=...,
  115. ascending: bool = ...,
  116. pct: bool = ...,
  117. na_option=...,
  118. ) -> np.ndarray: ... # np.ndarray[float64_t, ndim=1]
  119. def rank_2d(
  120. in_arr: np.ndarray, # ndarray[rank_t, ndim=2]
  121. axis: int = ...,
  122. is_datetimelike: bool = ...,
  123. ties_method=...,
  124. ascending: bool = ...,
  125. na_option=...,
  126. pct: bool = ...,
  127. ) -> np.ndarray: ... # np.ndarray[float64_t, ndim=1]
  128. def diff_2d(
  129. arr: np.ndarray, # ndarray[diff_t, ndim=2]
  130. out: np.ndarray, # ndarray[out_t, ndim=2]
  131. periods: int,
  132. axis: int,
  133. datetimelike: bool = ...,
  134. ) -> None: ...
  135. def ensure_platform_int(arr: object) -> np.ndarray: ...
  136. def ensure_object(arr: object) -> np.ndarray: ...
  137. def ensure_float64(arr: object, copy=True) -> np.ndarray: ...
  138. def ensure_float32(arr: object, copy=True) -> np.ndarray: ...
  139. def ensure_int8(arr: object, copy=True) -> np.ndarray: ...
  140. def ensure_int16(arr: object, copy=True) -> np.ndarray: ...
  141. def ensure_int32(arr: object, copy=True) -> np.ndarray: ...
  142. def ensure_int64(arr: object, copy=True) -> np.ndarray: ...
  143. def ensure_uint8(arr: object, copy=True) -> np.ndarray: ...
  144. def ensure_uint16(arr: object, copy=True) -> np.ndarray: ...
  145. def ensure_uint32(arr: object, copy=True) -> np.ndarray: ...
  146. def ensure_uint64(arr: object, copy=True) -> np.ndarray: ...
  147. def take_1d_int8_int8(
  148. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  149. ) -> None: ...
  150. def take_1d_int8_int32(
  151. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  152. ) -> None: ...
  153. def take_1d_int8_int64(
  154. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  155. ) -> None: ...
  156. def take_1d_int8_float64(
  157. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  158. ) -> None: ...
  159. def take_1d_int16_int16(
  160. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  161. ) -> None: ...
  162. def take_1d_int16_int32(
  163. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  164. ) -> None: ...
  165. def take_1d_int16_int64(
  166. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  167. ) -> None: ...
  168. def take_1d_int16_float64(
  169. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  170. ) -> None: ...
  171. def take_1d_int32_int32(
  172. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  173. ) -> None: ...
  174. def take_1d_int32_int64(
  175. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  176. ) -> None: ...
  177. def take_1d_int32_float64(
  178. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  179. ) -> None: ...
  180. def take_1d_int64_int64(
  181. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  182. ) -> None: ...
  183. def take_1d_int64_float64(
  184. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  185. ) -> None: ...
  186. def take_1d_float32_float32(
  187. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  188. ) -> None: ...
  189. def take_1d_float32_float64(
  190. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  191. ) -> None: ...
  192. def take_1d_float64_float64(
  193. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  194. ) -> None: ...
  195. def take_1d_object_object(
  196. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  197. ) -> None: ...
  198. def take_1d_bool_bool(
  199. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  200. ) -> None: ...
  201. def take_1d_bool_object(
  202. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  203. ) -> None: ...
  204. def take_2d_axis0_int8_int8(
  205. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  206. ) -> None: ...
  207. def take_2d_axis0_int8_int32(
  208. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  209. ) -> None: ...
  210. def take_2d_axis0_int8_int64(
  211. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  212. ) -> None: ...
  213. def take_2d_axis0_int8_float64(
  214. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  215. ) -> None: ...
  216. def take_2d_axis0_int16_int16(
  217. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  218. ) -> None: ...
  219. def take_2d_axis0_int16_int32(
  220. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  221. ) -> None: ...
  222. def take_2d_axis0_int16_int64(
  223. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  224. ) -> None: ...
  225. def take_2d_axis0_int16_float64(
  226. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  227. ) -> None: ...
  228. def take_2d_axis0_int32_int32(
  229. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  230. ) -> None: ...
  231. def take_2d_axis0_int32_int64(
  232. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  233. ) -> None: ...
  234. def take_2d_axis0_int32_float64(
  235. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  236. ) -> None: ...
  237. def take_2d_axis0_int64_int64(
  238. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  239. ) -> None: ...
  240. def take_2d_axis0_int64_float64(
  241. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  242. ) -> None: ...
  243. def take_2d_axis0_float32_float32(
  244. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  245. ) -> None: ...
  246. def take_2d_axis0_float32_float64(
  247. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  248. ) -> None: ...
  249. def take_2d_axis0_float64_float64(
  250. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  251. ) -> None: ...
  252. def take_2d_axis0_object_object(
  253. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  254. ) -> None: ...
  255. def take_2d_axis0_bool_bool(
  256. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  257. ) -> None: ...
  258. def take_2d_axis0_bool_object(
  259. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  260. ) -> None: ...
  261. def take_2d_axis1_int8_int8(
  262. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  263. ) -> None: ...
  264. def take_2d_axis1_int8_int32(
  265. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  266. ) -> None: ...
  267. def take_2d_axis1_int8_int64(
  268. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  269. ) -> None: ...
  270. def take_2d_axis1_int8_float64(
  271. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  272. ) -> None: ...
  273. def take_2d_axis1_int16_int16(
  274. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  275. ) -> None: ...
  276. def take_2d_axis1_int16_int32(
  277. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  278. ) -> None: ...
  279. def take_2d_axis1_int16_int64(
  280. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  281. ) -> None: ...
  282. def take_2d_axis1_int16_float64(
  283. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  284. ) -> None: ...
  285. def take_2d_axis1_int32_int32(
  286. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  287. ) -> None: ...
  288. def take_2d_axis1_int32_int64(
  289. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  290. ) -> None: ...
  291. def take_2d_axis1_int32_float64(
  292. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  293. ) -> None: ...
  294. def take_2d_axis1_int64_int64(
  295. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  296. ) -> None: ...
  297. def take_2d_axis1_int64_float64(
  298. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  299. ) -> None: ...
  300. def take_2d_axis1_float32_float32(
  301. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  302. ) -> None: ...
  303. def take_2d_axis1_float32_float64(
  304. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  305. ) -> None: ...
  306. def take_2d_axis1_float64_float64(
  307. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  308. ) -> None: ...
  309. def take_2d_axis1_object_object(
  310. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  311. ) -> None: ...
  312. def take_2d_axis1_bool_bool(
  313. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  314. ) -> None: ...
  315. def take_2d_axis1_bool_object(
  316. values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
  317. ) -> None: ...
  318. def take_2d_multi_int8_int8(
  319. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  320. ) -> None: ...
  321. def take_2d_multi_int8_int32(
  322. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  323. ) -> None: ...
  324. def take_2d_multi_int8_int64(
  325. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  326. ) -> None: ...
  327. def take_2d_multi_int8_float64(
  328. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  329. ) -> None: ...
  330. def take_2d_multi_int16_int16(
  331. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  332. ) -> None: ...
  333. def take_2d_multi_int16_int32(
  334. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  335. ) -> None: ...
  336. def take_2d_multi_int16_int64(
  337. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  338. ) -> None: ...
  339. def take_2d_multi_int16_float64(
  340. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  341. ) -> None: ...
  342. def take_2d_multi_int32_int32(
  343. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  344. ) -> None: ...
  345. def take_2d_multi_int32_int64(
  346. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  347. ) -> None: ...
  348. def take_2d_multi_int32_float64(
  349. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  350. ) -> None: ...
  351. def take_2d_multi_int64_float64(
  352. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  353. ) -> None: ...
  354. def take_2d_multi_float32_float32(
  355. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  356. ) -> None: ...
  357. def take_2d_multi_float32_float64(
  358. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  359. ) -> None: ...
  360. def take_2d_multi_float64_float64(
  361. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  362. ) -> None: ...
  363. def take_2d_multi_object_object(
  364. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  365. ) -> None: ...
  366. def take_2d_multi_bool_bool(
  367. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  368. ) -> None: ...
  369. def take_2d_multi_bool_object(
  370. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  371. ) -> None: ...
  372. def take_2d_multi_int64_int64(
  373. values: np.ndarray, indexer, out: np.ndarray, fill_value=...
  374. ) -> None: ...