function_base.pyi 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. import sys
  2. from collections.abc import Sequence, Iterator, Callable, Iterable
  3. from typing import (
  4. Literal as L,
  5. Any,
  6. TypeVar,
  7. overload,
  8. Protocol,
  9. SupportsIndex,
  10. SupportsInt,
  11. )
  12. if sys.version_info >= (3, 10):
  13. from typing import TypeGuard
  14. else:
  15. from typing_extensions import TypeGuard
  16. from numpy import (
  17. vectorize as vectorize,
  18. ufunc,
  19. generic,
  20. floating,
  21. complexfloating,
  22. intp,
  23. float64,
  24. complex128,
  25. timedelta64,
  26. datetime64,
  27. object_,
  28. _OrderKACF,
  29. )
  30. from numpy._typing import (
  31. NDArray,
  32. ArrayLike,
  33. DTypeLike,
  34. _ShapeLike,
  35. _ScalarLike_co,
  36. _DTypeLike,
  37. _ArrayLike,
  38. _ArrayLikeInt_co,
  39. _ArrayLikeFloat_co,
  40. _ArrayLikeComplex_co,
  41. _ArrayLikeTD64_co,
  42. _ArrayLikeDT64_co,
  43. _ArrayLikeObject_co,
  44. _FloatLike_co,
  45. _ComplexLike_co,
  46. )
  47. from numpy.core.function_base import (
  48. add_newdoc as add_newdoc,
  49. )
  50. from numpy.core.multiarray import (
  51. add_docstring as add_docstring,
  52. bincount as bincount,
  53. )
  54. from numpy.core.umath import _add_newdoc_ufunc
  55. _T = TypeVar("_T")
  56. _T_co = TypeVar("_T_co", covariant=True)
  57. _SCT = TypeVar("_SCT", bound=generic)
  58. _ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
  59. _2Tuple = tuple[_T, _T]
  60. class _TrimZerosSequence(Protocol[_T_co]):
  61. def __len__(self) -> int: ...
  62. def __getitem__(self, key: slice, /) -> _T_co: ...
  63. def __iter__(self) -> Iterator[Any]: ...
  64. class _SupportsWriteFlush(Protocol):
  65. def write(self, s: str, /) -> object: ...
  66. def flush(self) -> object: ...
  67. __all__: list[str]
  68. # NOTE: This is in reality a re-export of `np.core.umath._add_newdoc_ufunc`
  69. def add_newdoc_ufunc(ufunc: ufunc, new_docstring: str, /) -> None: ...
  70. @overload
  71. def rot90(
  72. m: _ArrayLike[_SCT],
  73. k: int = ...,
  74. axes: tuple[int, int] = ...,
  75. ) -> NDArray[_SCT]: ...
  76. @overload
  77. def rot90(
  78. m: ArrayLike,
  79. k: int = ...,
  80. axes: tuple[int, int] = ...,
  81. ) -> NDArray[Any]: ...
  82. @overload
  83. def flip(m: _SCT, axis: None = ...) -> _SCT: ...
  84. @overload
  85. def flip(m: _ScalarLike_co, axis: None = ...) -> Any: ...
  86. @overload
  87. def flip(m: _ArrayLike[_SCT], axis: None | _ShapeLike = ...) -> NDArray[_SCT]: ...
  88. @overload
  89. def flip(m: ArrayLike, axis: None | _ShapeLike = ...) -> NDArray[Any]: ...
  90. def iterable(y: object) -> TypeGuard[Iterable[Any]]: ...
  91. @overload
  92. def average(
  93. a: _ArrayLikeFloat_co,
  94. axis: None = ...,
  95. weights: None | _ArrayLikeFloat_co= ...,
  96. returned: L[False] = ...,
  97. keepdims: L[False] = ...,
  98. ) -> floating[Any]: ...
  99. @overload
  100. def average(
  101. a: _ArrayLikeComplex_co,
  102. axis: None = ...,
  103. weights: None | _ArrayLikeComplex_co = ...,
  104. returned: L[False] = ...,
  105. keepdims: L[False] = ...,
  106. ) -> complexfloating[Any, Any]: ...
  107. @overload
  108. def average(
  109. a: _ArrayLikeObject_co,
  110. axis: None = ...,
  111. weights: None | Any = ...,
  112. returned: L[False] = ...,
  113. keepdims: L[False] = ...,
  114. ) -> Any: ...
  115. @overload
  116. def average(
  117. a: _ArrayLikeFloat_co,
  118. axis: None = ...,
  119. weights: None | _ArrayLikeFloat_co= ...,
  120. returned: L[True] = ...,
  121. keepdims: L[False] = ...,
  122. ) -> _2Tuple[floating[Any]]: ...
  123. @overload
  124. def average(
  125. a: _ArrayLikeComplex_co,
  126. axis: None = ...,
  127. weights: None | _ArrayLikeComplex_co = ...,
  128. returned: L[True] = ...,
  129. keepdims: L[False] = ...,
  130. ) -> _2Tuple[complexfloating[Any, Any]]: ...
  131. @overload
  132. def average(
  133. a: _ArrayLikeObject_co,
  134. axis: None = ...,
  135. weights: None | Any = ...,
  136. returned: L[True] = ...,
  137. keepdims: L[False] = ...,
  138. ) -> _2Tuple[Any]: ...
  139. @overload
  140. def average(
  141. a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
  142. axis: None | _ShapeLike = ...,
  143. weights: None | Any = ...,
  144. returned: L[False] = ...,
  145. keepdims: bool = ...,
  146. ) -> Any: ...
  147. @overload
  148. def average(
  149. a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
  150. axis: None | _ShapeLike = ...,
  151. weights: None | Any = ...,
  152. returned: L[True] = ...,
  153. keepdims: bool = ...,
  154. ) -> _2Tuple[Any]: ...
  155. @overload
  156. def asarray_chkfinite(
  157. a: _ArrayLike[_SCT],
  158. dtype: None = ...,
  159. order: _OrderKACF = ...,
  160. ) -> NDArray[_SCT]: ...
  161. @overload
  162. def asarray_chkfinite(
  163. a: object,
  164. dtype: None = ...,
  165. order: _OrderKACF = ...,
  166. ) -> NDArray[Any]: ...
  167. @overload
  168. def asarray_chkfinite(
  169. a: Any,
  170. dtype: _DTypeLike[_SCT],
  171. order: _OrderKACF = ...,
  172. ) -> NDArray[_SCT]: ...
  173. @overload
  174. def asarray_chkfinite(
  175. a: Any,
  176. dtype: DTypeLike,
  177. order: _OrderKACF = ...,
  178. ) -> NDArray[Any]: ...
  179. # TODO: Use PEP 612 `ParamSpec` once mypy supports `Concatenate`
  180. # xref python/mypy#8645
  181. @overload
  182. def piecewise(
  183. x: _ArrayLike[_SCT],
  184. condlist: ArrayLike,
  185. funclist: Sequence[Any | Callable[..., Any]],
  186. *args: Any,
  187. **kw: Any,
  188. ) -> NDArray[_SCT]: ...
  189. @overload
  190. def piecewise(
  191. x: ArrayLike,
  192. condlist: ArrayLike,
  193. funclist: Sequence[Any | Callable[..., Any]],
  194. *args: Any,
  195. **kw: Any,
  196. ) -> NDArray[Any]: ...
  197. def select(
  198. condlist: Sequence[ArrayLike],
  199. choicelist: Sequence[ArrayLike],
  200. default: ArrayLike = ...,
  201. ) -> NDArray[Any]: ...
  202. @overload
  203. def copy(
  204. a: _ArrayType,
  205. order: _OrderKACF,
  206. subok: L[True],
  207. ) -> _ArrayType: ...
  208. @overload
  209. def copy(
  210. a: _ArrayType,
  211. order: _OrderKACF = ...,
  212. *,
  213. subok: L[True],
  214. ) -> _ArrayType: ...
  215. @overload
  216. def copy(
  217. a: _ArrayLike[_SCT],
  218. order: _OrderKACF = ...,
  219. subok: L[False] = ...,
  220. ) -> NDArray[_SCT]: ...
  221. @overload
  222. def copy(
  223. a: ArrayLike,
  224. order: _OrderKACF = ...,
  225. subok: L[False] = ...,
  226. ) -> NDArray[Any]: ...
  227. def gradient(
  228. f: ArrayLike,
  229. *varargs: ArrayLike,
  230. axis: None | _ShapeLike = ...,
  231. edge_order: L[1, 2] = ...,
  232. ) -> Any: ...
  233. @overload
  234. def diff(
  235. a: _T,
  236. n: L[0],
  237. axis: SupportsIndex = ...,
  238. prepend: ArrayLike = ...,
  239. append: ArrayLike = ...,
  240. ) -> _T: ...
  241. @overload
  242. def diff(
  243. a: ArrayLike,
  244. n: int = ...,
  245. axis: SupportsIndex = ...,
  246. prepend: ArrayLike = ...,
  247. append: ArrayLike = ...,
  248. ) -> NDArray[Any]: ...
  249. @overload
  250. def interp(
  251. x: _ArrayLikeFloat_co,
  252. xp: _ArrayLikeFloat_co,
  253. fp: _ArrayLikeFloat_co,
  254. left: None | _FloatLike_co = ...,
  255. right: None | _FloatLike_co = ...,
  256. period: None | _FloatLike_co = ...,
  257. ) -> NDArray[float64]: ...
  258. @overload
  259. def interp(
  260. x: _ArrayLikeFloat_co,
  261. xp: _ArrayLikeFloat_co,
  262. fp: _ArrayLikeComplex_co,
  263. left: None | _ComplexLike_co = ...,
  264. right: None | _ComplexLike_co = ...,
  265. period: None | _FloatLike_co = ...,
  266. ) -> NDArray[complex128]: ...
  267. @overload
  268. def angle(z: _ComplexLike_co, deg: bool = ...) -> floating[Any]: ...
  269. @overload
  270. def angle(z: object_, deg: bool = ...) -> Any: ...
  271. @overload
  272. def angle(z: _ArrayLikeComplex_co, deg: bool = ...) -> NDArray[floating[Any]]: ...
  273. @overload
  274. def angle(z: _ArrayLikeObject_co, deg: bool = ...) -> NDArray[object_]: ...
  275. @overload
  276. def unwrap(
  277. p: _ArrayLikeFloat_co,
  278. discont: None | float = ...,
  279. axis: int = ...,
  280. *,
  281. period: float = ...,
  282. ) -> NDArray[floating[Any]]: ...
  283. @overload
  284. def unwrap(
  285. p: _ArrayLikeObject_co,
  286. discont: None | float = ...,
  287. axis: int = ...,
  288. *,
  289. period: float = ...,
  290. ) -> NDArray[object_]: ...
  291. def sort_complex(a: ArrayLike) -> NDArray[complexfloating[Any, Any]]: ...
  292. def trim_zeros(
  293. filt: _TrimZerosSequence[_T],
  294. trim: L["f", "b", "fb", "bf"] = ...,
  295. ) -> _T: ...
  296. @overload
  297. def extract(condition: ArrayLike, arr: _ArrayLike[_SCT]) -> NDArray[_SCT]: ...
  298. @overload
  299. def extract(condition: ArrayLike, arr: ArrayLike) -> NDArray[Any]: ...
  300. def place(arr: NDArray[Any], mask: ArrayLike, vals: Any) -> None: ...
  301. def disp(
  302. mesg: object,
  303. device: None | _SupportsWriteFlush = ...,
  304. linefeed: bool = ...,
  305. ) -> None: ...
  306. @overload
  307. def cov(
  308. m: _ArrayLikeFloat_co,
  309. y: None | _ArrayLikeFloat_co = ...,
  310. rowvar: bool = ...,
  311. bias: bool = ...,
  312. ddof: None | SupportsIndex | SupportsInt = ...,
  313. fweights: None | ArrayLike = ...,
  314. aweights: None | ArrayLike = ...,
  315. *,
  316. dtype: None = ...,
  317. ) -> NDArray[floating[Any]]: ...
  318. @overload
  319. def cov(
  320. m: _ArrayLikeComplex_co,
  321. y: None | _ArrayLikeComplex_co = ...,
  322. rowvar: bool = ...,
  323. bias: bool = ...,
  324. ddof: None | SupportsIndex | SupportsInt = ...,
  325. fweights: None | ArrayLike = ...,
  326. aweights: None | ArrayLike = ...,
  327. *,
  328. dtype: None = ...,
  329. ) -> NDArray[complexfloating[Any, Any]]: ...
  330. @overload
  331. def cov(
  332. m: _ArrayLikeComplex_co,
  333. y: None | _ArrayLikeComplex_co = ...,
  334. rowvar: bool = ...,
  335. bias: bool = ...,
  336. ddof: None | SupportsIndex | SupportsInt = ...,
  337. fweights: None | ArrayLike = ...,
  338. aweights: None | ArrayLike = ...,
  339. *,
  340. dtype: _DTypeLike[_SCT],
  341. ) -> NDArray[_SCT]: ...
  342. @overload
  343. def cov(
  344. m: _ArrayLikeComplex_co,
  345. y: None | _ArrayLikeComplex_co = ...,
  346. rowvar: bool = ...,
  347. bias: bool = ...,
  348. ddof: None | SupportsIndex | SupportsInt = ...,
  349. fweights: None | ArrayLike = ...,
  350. aweights: None | ArrayLike = ...,
  351. *,
  352. dtype: DTypeLike,
  353. ) -> NDArray[Any]: ...
  354. # NOTE `bias` and `ddof` have been deprecated
  355. @overload
  356. def corrcoef(
  357. m: _ArrayLikeFloat_co,
  358. y: None | _ArrayLikeFloat_co = ...,
  359. rowvar: bool = ...,
  360. *,
  361. dtype: None = ...,
  362. ) -> NDArray[floating[Any]]: ...
  363. @overload
  364. def corrcoef(
  365. m: _ArrayLikeComplex_co,
  366. y: None | _ArrayLikeComplex_co = ...,
  367. rowvar: bool = ...,
  368. *,
  369. dtype: None = ...,
  370. ) -> NDArray[complexfloating[Any, Any]]: ...
  371. @overload
  372. def corrcoef(
  373. m: _ArrayLikeComplex_co,
  374. y: None | _ArrayLikeComplex_co = ...,
  375. rowvar: bool = ...,
  376. *,
  377. dtype: _DTypeLike[_SCT],
  378. ) -> NDArray[_SCT]: ...
  379. @overload
  380. def corrcoef(
  381. m: _ArrayLikeComplex_co,
  382. y: None | _ArrayLikeComplex_co = ...,
  383. rowvar: bool = ...,
  384. *,
  385. dtype: DTypeLike,
  386. ) -> NDArray[Any]: ...
  387. def blackman(M: _FloatLike_co) -> NDArray[floating[Any]]: ...
  388. def bartlett(M: _FloatLike_co) -> NDArray[floating[Any]]: ...
  389. def hanning(M: _FloatLike_co) -> NDArray[floating[Any]]: ...
  390. def hamming(M: _FloatLike_co) -> NDArray[floating[Any]]: ...
  391. def i0(x: _ArrayLikeFloat_co) -> NDArray[floating[Any]]: ...
  392. def kaiser(
  393. M: _FloatLike_co,
  394. beta: _FloatLike_co,
  395. ) -> NDArray[floating[Any]]: ...
  396. @overload
  397. def sinc(x: _FloatLike_co) -> floating[Any]: ...
  398. @overload
  399. def sinc(x: _ComplexLike_co) -> complexfloating[Any, Any]: ...
  400. @overload
  401. def sinc(x: _ArrayLikeFloat_co) -> NDArray[floating[Any]]: ...
  402. @overload
  403. def sinc(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]: ...
  404. # NOTE: Deprecated
  405. # def msort(a: ArrayLike) -> NDArray[Any]: ...
  406. @overload
  407. def median(
  408. a: _ArrayLikeFloat_co,
  409. axis: None = ...,
  410. out: None = ...,
  411. overwrite_input: bool = ...,
  412. keepdims: L[False] = ...,
  413. ) -> floating[Any]: ...
  414. @overload
  415. def median(
  416. a: _ArrayLikeComplex_co,
  417. axis: None = ...,
  418. out: None = ...,
  419. overwrite_input: bool = ...,
  420. keepdims: L[False] = ...,
  421. ) -> complexfloating[Any, Any]: ...
  422. @overload
  423. def median(
  424. a: _ArrayLikeTD64_co,
  425. axis: None = ...,
  426. out: None = ...,
  427. overwrite_input: bool = ...,
  428. keepdims: L[False] = ...,
  429. ) -> timedelta64: ...
  430. @overload
  431. def median(
  432. a: _ArrayLikeObject_co,
  433. axis: None = ...,
  434. out: None = ...,
  435. overwrite_input: bool = ...,
  436. keepdims: L[False] = ...,
  437. ) -> Any: ...
  438. @overload
  439. def median(
  440. a: _ArrayLikeFloat_co | _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
  441. axis: None | _ShapeLike = ...,
  442. out: None = ...,
  443. overwrite_input: bool = ...,
  444. keepdims: bool = ...,
  445. ) -> Any: ...
  446. @overload
  447. def median(
  448. a: _ArrayLikeFloat_co | _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
  449. axis: None | _ShapeLike = ...,
  450. out: _ArrayType = ...,
  451. overwrite_input: bool = ...,
  452. keepdims: bool = ...,
  453. ) -> _ArrayType: ...
  454. _MethodKind = L[
  455. "inverted_cdf",
  456. "averaged_inverted_cdf",
  457. "closest_observation",
  458. "interpolated_inverted_cdf",
  459. "hazen",
  460. "weibull",
  461. "linear",
  462. "median_unbiased",
  463. "normal_unbiased",
  464. "lower",
  465. "higher",
  466. "midpoint",
  467. "nearest",
  468. ]
  469. @overload
  470. def percentile(
  471. a: _ArrayLikeFloat_co,
  472. q: _FloatLike_co,
  473. axis: None = ...,
  474. out: None = ...,
  475. overwrite_input: bool = ...,
  476. method: _MethodKind = ...,
  477. keepdims: L[False] = ...,
  478. ) -> floating[Any]: ...
  479. @overload
  480. def percentile(
  481. a: _ArrayLikeComplex_co,
  482. q: _FloatLike_co,
  483. axis: None = ...,
  484. out: None = ...,
  485. overwrite_input: bool = ...,
  486. method: _MethodKind = ...,
  487. keepdims: L[False] = ...,
  488. ) -> complexfloating[Any, Any]: ...
  489. @overload
  490. def percentile(
  491. a: _ArrayLikeTD64_co,
  492. q: _FloatLike_co,
  493. axis: None = ...,
  494. out: None = ...,
  495. overwrite_input: bool = ...,
  496. method: _MethodKind = ...,
  497. keepdims: L[False] = ...,
  498. ) -> timedelta64: ...
  499. @overload
  500. def percentile(
  501. a: _ArrayLikeDT64_co,
  502. q: _FloatLike_co,
  503. axis: None = ...,
  504. out: None = ...,
  505. overwrite_input: bool = ...,
  506. method: _MethodKind = ...,
  507. keepdims: L[False] = ...,
  508. ) -> datetime64: ...
  509. @overload
  510. def percentile(
  511. a: _ArrayLikeObject_co,
  512. q: _FloatLike_co,
  513. axis: None = ...,
  514. out: None = ...,
  515. overwrite_input: bool = ...,
  516. method: _MethodKind = ...,
  517. keepdims: L[False] = ...,
  518. ) -> Any: ...
  519. @overload
  520. def percentile(
  521. a: _ArrayLikeFloat_co,
  522. q: _ArrayLikeFloat_co,
  523. axis: None = ...,
  524. out: None = ...,
  525. overwrite_input: bool = ...,
  526. method: _MethodKind = ...,
  527. keepdims: L[False] = ...,
  528. ) -> NDArray[floating[Any]]: ...
  529. @overload
  530. def percentile(
  531. a: _ArrayLikeComplex_co,
  532. q: _ArrayLikeFloat_co,
  533. axis: None = ...,
  534. out: None = ...,
  535. overwrite_input: bool = ...,
  536. method: _MethodKind = ...,
  537. keepdims: L[False] = ...,
  538. ) -> NDArray[complexfloating[Any, Any]]: ...
  539. @overload
  540. def percentile(
  541. a: _ArrayLikeTD64_co,
  542. q: _ArrayLikeFloat_co,
  543. axis: None = ...,
  544. out: None = ...,
  545. overwrite_input: bool = ...,
  546. method: _MethodKind = ...,
  547. keepdims: L[False] = ...,
  548. ) -> NDArray[timedelta64]: ...
  549. @overload
  550. def percentile(
  551. a: _ArrayLikeDT64_co,
  552. q: _ArrayLikeFloat_co,
  553. axis: None = ...,
  554. out: None = ...,
  555. overwrite_input: bool = ...,
  556. method: _MethodKind = ...,
  557. keepdims: L[False] = ...,
  558. ) -> NDArray[datetime64]: ...
  559. @overload
  560. def percentile(
  561. a: _ArrayLikeObject_co,
  562. q: _ArrayLikeFloat_co,
  563. axis: None = ...,
  564. out: None = ...,
  565. overwrite_input: bool = ...,
  566. method: _MethodKind = ...,
  567. keepdims: L[False] = ...,
  568. ) -> NDArray[object_]: ...
  569. @overload
  570. def percentile(
  571. a: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
  572. q: _ArrayLikeFloat_co,
  573. axis: None | _ShapeLike = ...,
  574. out: None = ...,
  575. overwrite_input: bool = ...,
  576. method: _MethodKind = ...,
  577. keepdims: bool = ...,
  578. ) -> Any: ...
  579. @overload
  580. def percentile(
  581. a: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
  582. q: _ArrayLikeFloat_co,
  583. axis: None | _ShapeLike = ...,
  584. out: _ArrayType = ...,
  585. overwrite_input: bool = ...,
  586. method: _MethodKind = ...,
  587. keepdims: bool = ...,
  588. ) -> _ArrayType: ...
  589. # NOTE: Not an alias, but they do have identical signatures
  590. # (that we can reuse)
  591. quantile = percentile
  592. # TODO: Returns a scalar for <= 1D array-likes; returns an ndarray otherwise
  593. def trapz(
  594. y: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co,
  595. x: None | _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co = ...,
  596. dx: float = ...,
  597. axis: SupportsIndex = ...,
  598. ) -> Any: ...
  599. def meshgrid(
  600. *xi: ArrayLike,
  601. copy: bool = ...,
  602. sparse: bool = ...,
  603. indexing: L["xy", "ij"] = ...,
  604. ) -> list[NDArray[Any]]: ...
  605. @overload
  606. def delete(
  607. arr: _ArrayLike[_SCT],
  608. obj: slice | _ArrayLikeInt_co,
  609. axis: None | SupportsIndex = ...,
  610. ) -> NDArray[_SCT]: ...
  611. @overload
  612. def delete(
  613. arr: ArrayLike,
  614. obj: slice | _ArrayLikeInt_co,
  615. axis: None | SupportsIndex = ...,
  616. ) -> NDArray[Any]: ...
  617. @overload
  618. def insert(
  619. arr: _ArrayLike[_SCT],
  620. obj: slice | _ArrayLikeInt_co,
  621. values: ArrayLike,
  622. axis: None | SupportsIndex = ...,
  623. ) -> NDArray[_SCT]: ...
  624. @overload
  625. def insert(
  626. arr: ArrayLike,
  627. obj: slice | _ArrayLikeInt_co,
  628. values: ArrayLike,
  629. axis: None | SupportsIndex = ...,
  630. ) -> NDArray[Any]: ...
  631. def append(
  632. arr: ArrayLike,
  633. values: ArrayLike,
  634. axis: None | SupportsIndex = ...,
  635. ) -> NDArray[Any]: ...
  636. @overload
  637. def digitize(
  638. x: _FloatLike_co,
  639. bins: _ArrayLikeFloat_co,
  640. right: bool = ...,
  641. ) -> intp: ...
  642. @overload
  643. def digitize(
  644. x: _ArrayLikeFloat_co,
  645. bins: _ArrayLikeFloat_co,
  646. right: bool = ...,
  647. ) -> NDArray[intp]: ...