numpy 2.5.2__cp315-cp315-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (942) hide show
  1. numpy/__config__.py +170 -0
  2. numpy/__config__.pyi +108 -0
  3. numpy/__init__.cython-30.pxd +1312 -0
  4. numpy/__init__.pxd +12 -0
  5. numpy/__init__.py +926 -0
  6. numpy/__init__.pyi +7691 -0
  7. numpy/_array_api_info.py +349 -0
  8. numpy/_array_api_info.pyi +177 -0
  9. numpy/_configtool.py +39 -0
  10. numpy/_configtool.pyi +1 -0
  11. numpy/_core/__init__.py +203 -0
  12. numpy/_core/__init__.pyi +666 -0
  13. numpy/_core/_add_newdocs.py +7131 -0
  14. numpy/_core/_add_newdocs.pyi +2 -0
  15. numpy/_core/_add_newdocs_scalars.py +381 -0
  16. numpy/_core/_add_newdocs_scalars.pyi +16 -0
  17. numpy/_core/_asarray.py +130 -0
  18. numpy/_core/_asarray.pyi +41 -0
  19. numpy/_core/_dtype.py +366 -0
  20. numpy/_core/_dtype.pyi +54 -0
  21. numpy/_core/_dtype_ctypes.py +120 -0
  22. numpy/_core/_dtype_ctypes.pyi +83 -0
  23. numpy/_core/_exceptions.py +162 -0
  24. numpy/_core/_exceptions.pyi +48 -0
  25. numpy/_core/_internal.py +964 -0
  26. numpy/_core/_internal.pyi +56 -0
  27. numpy/_core/_methods.py +252 -0
  28. numpy/_core/_methods.pyi +22 -0
  29. numpy/_core/_multiarray_tests.cp315-win32.lib +0 -0
  30. numpy/_core/_multiarray_tests.cp315-win32.pyd +0 -0
  31. numpy/_core/_multiarray_umath.cp315-win32.lib +0 -0
  32. numpy/_core/_multiarray_umath.cp315-win32.pyd +0 -0
  33. numpy/_core/_operand_flag_tests.cp315-win32.lib +0 -0
  34. numpy/_core/_operand_flag_tests.cp315-win32.pyd +0 -0
  35. numpy/_core/_rational_tests.cp315-win32.lib +0 -0
  36. numpy/_core/_rational_tests.cp315-win32.pyd +0 -0
  37. numpy/_core/_simd.cp315-win32.lib +0 -0
  38. numpy/_core/_simd.cp315-win32.pyd +0 -0
  39. numpy/_core/_simd.pyi +35 -0
  40. numpy/_core/_string_helpers.py +100 -0
  41. numpy/_core/_string_helpers.pyi +12 -0
  42. numpy/_core/_struct_ufunc_tests.cp315-win32.lib +0 -0
  43. numpy/_core/_struct_ufunc_tests.cp315-win32.pyd +0 -0
  44. numpy/_core/_type_aliases.py +130 -0
  45. numpy/_core/_type_aliases.pyi +86 -0
  46. numpy/_core/_ufunc_config.py +515 -0
  47. numpy/_core/_ufunc_config.pyi +67 -0
  48. numpy/_core/_umath_tests.cp315-win32.lib +0 -0
  49. numpy/_core/_umath_tests.cp315-win32.pyd +0 -0
  50. numpy/_core/_umath_tests.pyi +51 -0
  51. numpy/_core/arrayprint.py +1788 -0
  52. numpy/_core/arrayprint.pyi +152 -0
  53. numpy/_core/cversions.py +13 -0
  54. numpy/_core/defchararray.py +1429 -0
  55. numpy/_core/defchararray.pyi +778 -0
  56. numpy/_core/einsumfunc.py +1647 -0
  57. numpy/_core/einsumfunc.pyi +179 -0
  58. numpy/_core/fromnumeric.py +4271 -0
  59. numpy/_core/fromnumeric.pyi +3144 -0
  60. numpy/_core/function_base.py +547 -0
  61. numpy/_core/function_base.pyi +444 -0
  62. numpy/_core/getlimits.py +449 -0
  63. numpy/_core/getlimits.pyi +124 -0
  64. numpy/_core/include/numpy/__multiarray_api.c +386 -0
  65. numpy/_core/include/numpy/__multiarray_api.h +1708 -0
  66. numpy/_core/include/numpy/__ufunc_api.c +56 -0
  67. numpy/_core/include/numpy/__ufunc_api.h +357 -0
  68. numpy/_core/include/numpy/_neighborhood_iterator_imp.h +90 -0
  69. numpy/_core/include/numpy/_numpyconfig.h +33 -0
  70. numpy/_core/include/numpy/_public_dtype_api_table.h +86 -0
  71. numpy/_core/include/numpy/arrayobject.h +7 -0
  72. numpy/_core/include/numpy/arrayscalars.h +228 -0
  73. numpy/_core/include/numpy/dtype_api.h +557 -0
  74. numpy/_core/include/numpy/halffloat.h +70 -0
  75. numpy/_core/include/numpy/ndarrayobject.h +288 -0
  76. numpy/_core/include/numpy/ndarraytypes.h +2075 -0
  77. numpy/_core/include/numpy/npy_2_compat.h +430 -0
  78. numpy/_core/include/numpy/npy_2_complexcompat.h +28 -0
  79. numpy/_core/include/numpy/npy_3kcompat.h +374 -0
  80. numpy/_core/include/numpy/npy_common.h +989 -0
  81. numpy/_core/include/numpy/npy_cpu.h +126 -0
  82. numpy/_core/include/numpy/npy_endian.h +79 -0
  83. numpy/_core/include/numpy/npy_math.h +602 -0
  84. numpy/_core/include/numpy/npy_no_deprecated_api.h +20 -0
  85. numpy/_core/include/numpy/npy_os.h +42 -0
  86. numpy/_core/include/numpy/numpyconfig.h +187 -0
  87. numpy/_core/include/numpy/random/LICENSE.txt +21 -0
  88. numpy/_core/include/numpy/random/bitgen.h +20 -0
  89. numpy/_core/include/numpy/random/distributions.h +209 -0
  90. numpy/_core/include/numpy/random/libdivide.h +2079 -0
  91. numpy/_core/include/numpy/ufuncobject.h +368 -0
  92. numpy/_core/include/numpy/utils.h +99 -0
  93. numpy/_core/lib/npymath.lib +0 -0
  94. numpy/_core/lib/pkgconfig/numpy.pc +7 -0
  95. numpy/_core/memmap.py +362 -0
  96. numpy/_core/memmap.pyi +94 -0
  97. numpy/_core/multiarray.py +1743 -0
  98. numpy/_core/multiarray.pyi +1892 -0
  99. numpy/_core/numeric.py +2707 -0
  100. numpy/_core/numeric.pyi +1366 -0
  101. numpy/_core/numerictypes.py +576 -0
  102. numpy/_core/numerictypes.pyi +196 -0
  103. numpy/_core/overrides.py +188 -0
  104. numpy/_core/overrides.pyi +44 -0
  105. numpy/_core/printoptions.py +32 -0
  106. numpy/_core/printoptions.pyi +28 -0
  107. numpy/_core/records.py +1089 -0
  108. numpy/_core/records.pyi +336 -0
  109. numpy/_core/shape_base.py +996 -0
  110. numpy/_core/shape_base.pyi +210 -0
  111. numpy/_core/strings.py +1813 -0
  112. numpy/_core/strings.pyi +481 -0
  113. numpy/_core/tests/_locales.py +72 -0
  114. numpy/_core/tests/_natype.py +144 -0
  115. numpy/_core/tests/data/astype_copy.pkl +0 -0
  116. numpy/_core/tests/data/generate_umath_validation_data.cpp +170 -0
  117. numpy/_core/tests/data/recarray_from_file.fits +0 -0
  118. numpy/_core/tests/data/umath-validation-set-README.txt +15 -0
  119. numpy/_core/tests/data/umath-validation-set-arccos.csv +1429 -0
  120. numpy/_core/tests/data/umath-validation-set-arccosh.csv +1429 -0
  121. numpy/_core/tests/data/umath-validation-set-arcsin.csv +1429 -0
  122. numpy/_core/tests/data/umath-validation-set-arcsinh.csv +1429 -0
  123. numpy/_core/tests/data/umath-validation-set-arctan.csv +1429 -0
  124. numpy/_core/tests/data/umath-validation-set-arctanh.csv +1429 -0
  125. numpy/_core/tests/data/umath-validation-set-cbrt.csv +1429 -0
  126. numpy/_core/tests/data/umath-validation-set-cos.csv +1375 -0
  127. numpy/_core/tests/data/umath-validation-set-cosh.csv +1429 -0
  128. numpy/_core/tests/data/umath-validation-set-exp.csv +412 -0
  129. numpy/_core/tests/data/umath-validation-set-exp2.csv +1429 -0
  130. numpy/_core/tests/data/umath-validation-set-expm1.csv +1429 -0
  131. numpy/_core/tests/data/umath-validation-set-log.csv +271 -0
  132. numpy/_core/tests/data/umath-validation-set-log10.csv +1629 -0
  133. numpy/_core/tests/data/umath-validation-set-log1p.csv +1429 -0
  134. numpy/_core/tests/data/umath-validation-set-log2.csv +1629 -0
  135. numpy/_core/tests/data/umath-validation-set-sin.csv +1370 -0
  136. numpy/_core/tests/data/umath-validation-set-sinh.csv +1429 -0
  137. numpy/_core/tests/data/umath-validation-set-tan.csv +1429 -0
  138. numpy/_core/tests/data/umath-validation-set-tanh.csv +1429 -0
  139. numpy/_core/tests/examples/cython/checks.pyx +381 -0
  140. numpy/_core/tests/examples/cython/meson.build +52 -0
  141. numpy/_core/tests/examples/cython/setup.py +39 -0
  142. numpy/_core/tests/examples/limited_api/limited_api.c +455 -0
  143. numpy/_core/tests/examples/limited_api/limited_api_cython.pyx +155 -0
  144. numpy/_core/tests/examples/limited_api/meson.build +94 -0
  145. numpy/_core/tests/examples/limited_api/setup.py +24 -0
  146. numpy/_core/tests/test__exceptions.py +90 -0
  147. numpy/_core/tests/test_abc.py +54 -0
  148. numpy/_core/tests/test_api.py +668 -0
  149. numpy/_core/tests/test_argparse.py +90 -0
  150. numpy/_core/tests/test_array_api_info.py +113 -0
  151. numpy/_core/tests/test_array_coercion.py +943 -0
  152. numpy/_core/tests/test_array_interface.py +222 -0
  153. numpy/_core/tests/test_arraymethod.py +85 -0
  154. numpy/_core/tests/test_arrayobject.py +198 -0
  155. numpy/_core/tests/test_arrayprint.py +1363 -0
  156. numpy/_core/tests/test_casting_floatingpoint_errors.py +154 -0
  157. numpy/_core/tests/test_casting_unittests.py +970 -0
  158. numpy/_core/tests/test_conversion_utils.py +209 -0
  159. numpy/_core/tests/test_cpu_dispatcher.py +48 -0
  160. numpy/_core/tests/test_cpu_features.py +533 -0
  161. numpy/_core/tests/test_custom_dtypes.py +511 -0
  162. numpy/_core/tests/test_cython.py +377 -0
  163. numpy/_core/tests/test_datetime.py +3220 -0
  164. numpy/_core/tests/test_defchararray.py +879 -0
  165. numpy/_core/tests/test_deprecations.py +511 -0
  166. numpy/_core/tests/test_dlpack.py +262 -0
  167. numpy/_core/tests/test_dtype.py +2107 -0
  168. numpy/_core/tests/test_einsum.py +1368 -0
  169. numpy/_core/tests/test_errstate.py +131 -0
  170. numpy/_core/tests/test_extint128.py +217 -0
  171. numpy/_core/tests/test_finfo.py +86 -0
  172. numpy/_core/tests/test_function_base.py +502 -0
  173. numpy/_core/tests/test_getlimits.py +188 -0
  174. numpy/_core/tests/test_half.py +589 -0
  175. numpy/_core/tests/test_hashtable.py +156 -0
  176. numpy/_core/tests/test_indexerrors.py +122 -0
  177. numpy/_core/tests/test_indexing.py +1717 -0
  178. numpy/_core/tests/test_item_selection.py +178 -0
  179. numpy/_core/tests/test_limited_api.py +254 -0
  180. numpy/_core/tests/test_longdouble.py +370 -0
  181. numpy/_core/tests/test_mem_overlap.py +933 -0
  182. numpy/_core/tests/test_mem_policy.py +448 -0
  183. numpy/_core/tests/test_memmap.py +286 -0
  184. numpy/_core/tests/test_multiarray.py +11569 -0
  185. numpy/_core/tests/test_multiprocessing.py +55 -0
  186. numpy/_core/tests/test_multithreading.py +746 -0
  187. numpy/_core/tests/test_nditer.py +3690 -0
  188. numpy/_core/tests/test_nep50_promotions.py +287 -0
  189. numpy/_core/tests/test_numeric.py +4278 -0
  190. numpy/_core/tests/test_numerictypes.py +640 -0
  191. numpy/_core/tests/test_overrides.py +800 -0
  192. numpy/_core/tests/test_print.py +202 -0
  193. numpy/_core/tests/test_protocols.py +46 -0
  194. numpy/_core/tests/test_records.py +595 -0
  195. numpy/_core/tests/test_regression.py +2672 -0
  196. numpy/_core/tests/test_scalar_ctors.py +203 -0
  197. numpy/_core/tests/test_scalar_methods.py +327 -0
  198. numpy/_core/tests/test_scalarbuffer.py +154 -0
  199. numpy/_core/tests/test_scalarinherit.py +105 -0
  200. numpy/_core/tests/test_scalarmath.py +1167 -0
  201. numpy/_core/tests/test_scalarprint.py +403 -0
  202. numpy/_core/tests/test_shape_base.py +899 -0
  203. numpy/_core/tests/test_simd.py +1345 -0
  204. numpy/_core/tests/test_simd_module.py +105 -0
  205. numpy/_core/tests/test_stringdtype.py +2573 -0
  206. numpy/_core/tests/test_strings.py +1506 -0
  207. numpy/_core/tests/test_ufunc.py +3452 -0
  208. numpy/_core/tests/test_umath.py +5231 -0
  209. numpy/_core/tests/test_umath_accuracy.py +92 -0
  210. numpy/_core/tests/test_umath_complex.py +631 -0
  211. numpy/_core/tests/test_unicode.py +369 -0
  212. numpy/_core/umath.py +59 -0
  213. numpy/_core/umath.pyi +232 -0
  214. numpy/_distributor_init.py +15 -0
  215. numpy/_distributor_init.pyi +1 -0
  216. numpy/_expired_attrs_2_0.py +78 -0
  217. numpy/_expired_attrs_2_0.pyi +61 -0
  218. numpy/_globals.py +121 -0
  219. numpy/_globals.pyi +17 -0
  220. numpy/_pyinstaller/__init__.py +0 -0
  221. numpy/_pyinstaller/__init__.pyi +0 -0
  222. numpy/_pyinstaller/hook-numpy.py +35 -0
  223. numpy/_pyinstaller/hook-numpy.pyi +6 -0
  224. numpy/_pyinstaller/tests/__init__.py +16 -0
  225. numpy/_pyinstaller/tests/pyinstaller-smoke.py +32 -0
  226. numpy/_pyinstaller/tests/test_pyinstaller.py +35 -0
  227. numpy/_pytesttester.py +186 -0
  228. numpy/_pytesttester.pyi +18 -0
  229. numpy/_typing/__init__.py +147 -0
  230. numpy/_typing/_add_docstring.py +153 -0
  231. numpy/_typing/_array_like.py +92 -0
  232. numpy/_typing/_char_codes.py +156 -0
  233. numpy/_typing/_dtype_like.py +108 -0
  234. numpy/_typing/_extended_precision.py +15 -0
  235. numpy/_typing/_nbit.py +17 -0
  236. numpy/_typing/_nbit_base.py +93 -0
  237. numpy/_typing/_nbit_base.pyi +39 -0
  238. numpy/_typing/_nested_sequence.py +85 -0
  239. numpy/_typing/_scalars.py +20 -0
  240. numpy/_typing/_shape.py +8 -0
  241. numpy/_typing/_ufunc.py +7 -0
  242. numpy/_typing/_ufunc.pyi +970 -0
  243. numpy/_utils/__init__.py +95 -0
  244. numpy/_utils/__init__.pyi +25 -0
  245. numpy/_utils/_conversions.py +18 -0
  246. numpy/_utils/_conversions.pyi +4 -0
  247. numpy/_utils/_inspect.py +192 -0
  248. numpy/_utils/_inspect.pyi +67 -0
  249. numpy/_utils/_pep440.py +486 -0
  250. numpy/_utils/_pep440.pyi +121 -0
  251. numpy/char/__init__.py +31 -0
  252. numpy/char/__init__.pyi +111 -0
  253. numpy/conftest.py +249 -0
  254. numpy/core/__init__.py +33 -0
  255. numpy/core/__init__.pyi +45 -0
  256. numpy/core/_dtype.py +10 -0
  257. numpy/core/_dtype.pyi +0 -0
  258. numpy/core/_dtype_ctypes.py +10 -0
  259. numpy/core/_dtype_ctypes.pyi +0 -0
  260. numpy/core/_internal.py +27 -0
  261. numpy/core/_internal.pyi +1 -0
  262. numpy/core/_multiarray_umath.py +57 -0
  263. numpy/core/_utils.py +21 -0
  264. numpy/core/arrayprint.py +10 -0
  265. numpy/core/arrayprint.pyi +4 -0
  266. numpy/core/defchararray.py +10 -0
  267. numpy/core/defchararray.pyi +4 -0
  268. numpy/core/einsumfunc.py +10 -0
  269. numpy/core/einsumfunc.pyi +4 -0
  270. numpy/core/fromnumeric.py +10 -0
  271. numpy/core/fromnumeric.pyi +4 -0
  272. numpy/core/function_base.py +10 -0
  273. numpy/core/function_base.pyi +4 -0
  274. numpy/core/getlimits.py +10 -0
  275. numpy/core/getlimits.pyi +4 -0
  276. numpy/core/multiarray.py +25 -0
  277. numpy/core/multiarray.pyi +4 -0
  278. numpy/core/numeric.py +12 -0
  279. numpy/core/numeric.pyi +4 -0
  280. numpy/core/numerictypes.py +10 -0
  281. numpy/core/numerictypes.pyi +4 -0
  282. numpy/core/overrides.py +10 -0
  283. numpy/core/overrides.pyi +7 -0
  284. numpy/core/records.py +10 -0
  285. numpy/core/records.pyi +4 -0
  286. numpy/core/shape_base.py +10 -0
  287. numpy/core/shape_base.pyi +4 -0
  288. numpy/core/umath.py +10 -0
  289. numpy/core/umath.pyi +4 -0
  290. numpy/ctypeslib/__init__.py +13 -0
  291. numpy/ctypeslib/__init__.pyi +15 -0
  292. numpy/ctypeslib/_ctypeslib.py +603 -0
  293. numpy/ctypeslib/_ctypeslib.pyi +222 -0
  294. numpy/doc/ufuncs.py +138 -0
  295. numpy/dtypes.py +86 -0
  296. numpy/dtypes.pyi +627 -0
  297. numpy/exceptions.py +246 -0
  298. numpy/exceptions.pyi +27 -0
  299. numpy/f2py/__init__.py +80 -0
  300. numpy/f2py/__init__.pyi +5 -0
  301. numpy/f2py/__main__.py +5 -0
  302. numpy/f2py/__version__.py +1 -0
  303. numpy/f2py/__version__.pyi +1 -0
  304. numpy/f2py/_backends/__init__.py +6 -0
  305. numpy/f2py/_backends/__init__.pyi +5 -0
  306. numpy/f2py/_backends/_backend.py +44 -0
  307. numpy/f2py/_backends/_backend.pyi +46 -0
  308. numpy/f2py/_backends/_meson.py +244 -0
  309. numpy/f2py/_backends/_meson.pyi +61 -0
  310. numpy/f2py/_backends/meson.build.template +63 -0
  311. numpy/f2py/_isocbind.py +62 -0
  312. numpy/f2py/_isocbind.pyi +13 -0
  313. numpy/f2py/_src_pyf.py +247 -0
  314. numpy/f2py/_src_pyf.pyi +28 -0
  315. numpy/f2py/auxfuncs.py +1005 -0
  316. numpy/f2py/auxfuncs.pyi +259 -0
  317. numpy/f2py/capi_maps.py +811 -0
  318. numpy/f2py/capi_maps.pyi +33 -0
  319. numpy/f2py/cb_rules.py +649 -0
  320. numpy/f2py/cb_rules.pyi +17 -0
  321. numpy/f2py/cfuncs.py +1579 -0
  322. numpy/f2py/cfuncs.pyi +31 -0
  323. numpy/f2py/common_rules.py +145 -0
  324. numpy/f2py/common_rules.pyi +9 -0
  325. numpy/f2py/crackfortran.py +3727 -0
  326. numpy/f2py/crackfortran.pyi +254 -0
  327. numpy/f2py/diagnose.py +57 -0
  328. numpy/f2py/diagnose.pyi +1 -0
  329. numpy/f2py/f2py2e.py +755 -0
  330. numpy/f2py/f2py2e.pyi +69 -0
  331. numpy/f2py/f90mod_rules.py +281 -0
  332. numpy/f2py/f90mod_rules.pyi +16 -0
  333. numpy/f2py/func2subr.py +329 -0
  334. numpy/f2py/func2subr.pyi +7 -0
  335. numpy/f2py/rules.py +1641 -0
  336. numpy/f2py/rules.pyi +36 -0
  337. numpy/f2py/setup.cfg +3 -0
  338. numpy/f2py/src/fortranobject.c +1471 -0
  339. numpy/f2py/src/fortranobject.h +173 -0
  340. numpy/f2py/symbolic.py +1518 -0
  341. numpy/f2py/symbolic.pyi +220 -0
  342. numpy/f2py/tests/__init__.py +16 -0
  343. numpy/f2py/tests/src/abstract_interface/foo.f90 +34 -0
  344. numpy/f2py/tests/src/abstract_interface/gh18403_mod.f90 +6 -0
  345. numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c +262 -0
  346. numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap +1 -0
  347. numpy/f2py/tests/src/assumed_shape/foo_free.f90 +34 -0
  348. numpy/f2py/tests/src/assumed_shape/foo_mod.f90 +41 -0
  349. numpy/f2py/tests/src/assumed_shape/foo_use.f90 +19 -0
  350. numpy/f2py/tests/src/assumed_shape/precision.f90 +4 -0
  351. numpy/f2py/tests/src/block_docstring/foo.f +6 -0
  352. numpy/f2py/tests/src/callback/foo.f +62 -0
  353. numpy/f2py/tests/src/callback/gh17797.f90 +7 -0
  354. numpy/f2py/tests/src/callback/gh18335.f90 +17 -0
  355. numpy/f2py/tests/src/callback/gh25211.f +10 -0
  356. numpy/f2py/tests/src/callback/gh25211.pyf +18 -0
  357. numpy/f2py/tests/src/callback/gh26681.f90 +18 -0
  358. numpy/f2py/tests/src/cli/gh_22819.pyf +6 -0
  359. numpy/f2py/tests/src/cli/hi77.f +3 -0
  360. numpy/f2py/tests/src/cli/hiworld.f90 +3 -0
  361. numpy/f2py/tests/src/common/block.f +11 -0
  362. numpy/f2py/tests/src/common/gh19161.f90 +10 -0
  363. numpy/f2py/tests/src/crackfortran/accesstype.f90 +13 -0
  364. numpy/f2py/tests/src/crackfortran/common_with_division.f +17 -0
  365. numpy/f2py/tests/src/crackfortran/data_common.f +8 -0
  366. numpy/f2py/tests/src/crackfortran/data_multiplier.f +5 -0
  367. numpy/f2py/tests/src/crackfortran/data_stmts.f90 +20 -0
  368. numpy/f2py/tests/src/crackfortran/data_with_comments.f +8 -0
  369. numpy/f2py/tests/src/crackfortran/foo_deps.f90 +6 -0
  370. numpy/f2py/tests/src/crackfortran/gh15035.f +16 -0
  371. numpy/f2py/tests/src/crackfortran/gh17859.f +12 -0
  372. numpy/f2py/tests/src/crackfortran/gh22648.pyf +7 -0
  373. numpy/f2py/tests/src/crackfortran/gh23533.f +5 -0
  374. numpy/f2py/tests/src/crackfortran/gh23598.f90 +4 -0
  375. numpy/f2py/tests/src/crackfortran/gh23598Warn.f90 +11 -0
  376. numpy/f2py/tests/src/crackfortran/gh23879.f90 +20 -0
  377. numpy/f2py/tests/src/crackfortran/gh27697.f90 +12 -0
  378. numpy/f2py/tests/src/crackfortran/gh2848.f90 +13 -0
  379. numpy/f2py/tests/src/crackfortran/operators.f90 +49 -0
  380. numpy/f2py/tests/src/crackfortran/privatemod.f90 +11 -0
  381. numpy/f2py/tests/src/crackfortran/publicmod.f90 +10 -0
  382. numpy/f2py/tests/src/crackfortran/pubprivmod.f90 +10 -0
  383. numpy/f2py/tests/src/crackfortran/unicode_comment.f90 +4 -0
  384. numpy/f2py/tests/src/f2cmap/.f2py_f2cmap +1 -0
  385. numpy/f2py/tests/src/f2cmap/isoFortranEnvMap.f90 +9 -0
  386. numpy/f2py/tests/src/inplace/foo.f +31 -0
  387. numpy/f2py/tests/src/isocintrin/isoCtests.f90 +34 -0
  388. numpy/f2py/tests/src/kind/foo.f90 +20 -0
  389. numpy/f2py/tests/src/mixed/foo.f +5 -0
  390. numpy/f2py/tests/src/mixed/foo_fixed.f90 +8 -0
  391. numpy/f2py/tests/src/mixed/foo_free.f90 +8 -0
  392. numpy/f2py/tests/src/modules/gh25337/data.f90 +8 -0
  393. numpy/f2py/tests/src/modules/gh25337/use_data.f90 +6 -0
  394. numpy/f2py/tests/src/modules/gh26920/two_mods_with_no_public_entities.f90 +21 -0
  395. numpy/f2py/tests/src/modules/gh26920/two_mods_with_one_public_routine.f90 +21 -0
  396. numpy/f2py/tests/src/modules/module_data_docstring.f90 +12 -0
  397. numpy/f2py/tests/src/modules/use_modules.f90 +20 -0
  398. numpy/f2py/tests/src/negative_bounds/issue_20853.f90 +7 -0
  399. numpy/f2py/tests/src/parameter/constant_array.f90 +45 -0
  400. numpy/f2py/tests/src/parameter/constant_both.f90 +57 -0
  401. numpy/f2py/tests/src/parameter/constant_compound.f90 +15 -0
  402. numpy/f2py/tests/src/parameter/constant_integer.f90 +22 -0
  403. numpy/f2py/tests/src/parameter/constant_non_compound.f90 +23 -0
  404. numpy/f2py/tests/src/parameter/constant_real.f90 +23 -0
  405. numpy/f2py/tests/src/quoted_character/foo.f +14 -0
  406. numpy/f2py/tests/src/regression/AB.inc +1 -0
  407. numpy/f2py/tests/src/regression/assignOnlyModule.f90 +25 -0
  408. numpy/f2py/tests/src/regression/complex_struct_compat.f90 +8 -0
  409. numpy/f2py/tests/src/regression/complex_struct_compat.pyf +12 -0
  410. numpy/f2py/tests/src/regression/datonly.f90 +17 -0
  411. numpy/f2py/tests/src/regression/f77comments.f +26 -0
  412. numpy/f2py/tests/src/regression/f77fixedform.f95 +5 -0
  413. numpy/f2py/tests/src/regression/f90continuation.f90 +9 -0
  414. numpy/f2py/tests/src/regression/incfile.f90 +5 -0
  415. numpy/f2py/tests/src/regression/inout.f90 +9 -0
  416. numpy/f2py/tests/src/regression/lower_f2py_fortran.f90 +5 -0
  417. numpy/f2py/tests/src/regression/mod_derived_types.f90 +23 -0
  418. numpy/f2py/tests/src/return_character/foo77.f +45 -0
  419. numpy/f2py/tests/src/return_character/foo90.f90 +48 -0
  420. numpy/f2py/tests/src/return_complex/foo77.f +45 -0
  421. numpy/f2py/tests/src/return_complex/foo90.f90 +48 -0
  422. numpy/f2py/tests/src/return_integer/foo77.f +56 -0
  423. numpy/f2py/tests/src/return_integer/foo90.f90 +59 -0
  424. numpy/f2py/tests/src/return_logical/foo77.f +56 -0
  425. numpy/f2py/tests/src/return_logical/foo90.f90 +59 -0
  426. numpy/f2py/tests/src/return_real/foo77.f +45 -0
  427. numpy/f2py/tests/src/return_real/foo90.f90 +48 -0
  428. numpy/f2py/tests/src/routines/funcfortranname.f +5 -0
  429. numpy/f2py/tests/src/routines/funcfortranname.pyf +11 -0
  430. numpy/f2py/tests/src/routines/subrout.f +4 -0
  431. numpy/f2py/tests/src/routines/subrout.pyf +10 -0
  432. numpy/f2py/tests/src/size/foo.f90 +44 -0
  433. numpy/f2py/tests/src/string/char.f90 +29 -0
  434. numpy/f2py/tests/src/string/fixed_string.f90 +34 -0
  435. numpy/f2py/tests/src/string/gh24008.f +8 -0
  436. numpy/f2py/tests/src/string/gh24662.f90 +7 -0
  437. numpy/f2py/tests/src/string/gh25286.f90 +14 -0
  438. numpy/f2py/tests/src/string/gh25286.pyf +12 -0
  439. numpy/f2py/tests/src/string/gh25286_bc.pyf +12 -0
  440. numpy/f2py/tests/src/string/scalar_string.f90 +9 -0
  441. numpy/f2py/tests/src/string/string.f +12 -0
  442. numpy/f2py/tests/src/value_attrspec/gh21665.f90 +9 -0
  443. numpy/f2py/tests/test_abstract_interface.py +26 -0
  444. numpy/f2py/tests/test_array_from_pyobj.py +732 -0
  445. numpy/f2py/tests/test_assumed_shape.py +52 -0
  446. numpy/f2py/tests/test_block_docstring.py +16 -0
  447. numpy/f2py/tests/test_callback.py +262 -0
  448. numpy/f2py/tests/test_capi_maps.py +10 -0
  449. numpy/f2py/tests/test_character.py +644 -0
  450. numpy/f2py/tests/test_common.py +24 -0
  451. numpy/f2py/tests/test_crackfortran.py +427 -0
  452. numpy/f2py/tests/test_data.py +74 -0
  453. numpy/f2py/tests/test_docs.py +66 -0
  454. numpy/f2py/tests/test_f2cmap.py +20 -0
  455. numpy/f2py/tests/test_f2py2e.py +1006 -0
  456. numpy/f2py/tests/test_inplace.py +49 -0
  457. numpy/f2py/tests/test_isoc.py +56 -0
  458. numpy/f2py/tests/test_kind.py +53 -0
  459. numpy/f2py/tests/test_mixed.py +31 -0
  460. numpy/f2py/tests/test_modules.py +87 -0
  461. numpy/f2py/tests/test_parameter.py +121 -0
  462. numpy/f2py/tests/test_pyf_src.py +43 -0
  463. numpy/f2py/tests/test_quoted_character.py +19 -0
  464. numpy/f2py/tests/test_regression.py +202 -0
  465. numpy/f2py/tests/test_return_character.py +48 -0
  466. numpy/f2py/tests/test_return_complex.py +67 -0
  467. numpy/f2py/tests/test_return_integer.py +55 -0
  468. numpy/f2py/tests/test_return_logical.py +66 -0
  469. numpy/f2py/tests/test_return_real.py +109 -0
  470. numpy/f2py/tests/test_routines.py +29 -0
  471. numpy/f2py/tests/test_semicolon_split.py +76 -0
  472. numpy/f2py/tests/test_size.py +42 -0
  473. numpy/f2py/tests/test_string.py +102 -0
  474. numpy/f2py/tests/test_symbolic.py +501 -0
  475. numpy/f2py/tests/test_value_attrspec.py +15 -0
  476. numpy/f2py/tests/util.py +442 -0
  477. numpy/f2py/use_rules.py +100 -0
  478. numpy/f2py/use_rules.pyi +9 -0
  479. numpy/fft/__init__.py +213 -0
  480. numpy/fft/__init__.pyi +38 -0
  481. numpy/fft/_helper.py +235 -0
  482. numpy/fft/_helper.pyi +145 -0
  483. numpy/fft/_pocketfft.py +1693 -0
  484. numpy/fft/_pocketfft.pyi +1131 -0
  485. numpy/fft/_pocketfft_umath.cp315-win32.lib +0 -0
  486. numpy/fft/_pocketfft_umath.cp315-win32.pyd +0 -0
  487. numpy/fft/tests/__init__.py +0 -0
  488. numpy/fft/tests/test_helper.py +167 -0
  489. numpy/fft/tests/test_pocketfft.py +609 -0
  490. numpy/lib/__init__.py +90 -0
  491. numpy/lib/__init__.pyi +52 -0
  492. numpy/lib/_array_utils_impl.py +62 -0
  493. numpy/lib/_array_utils_impl.pyi +10 -0
  494. numpy/lib/_arraypad_impl.py +926 -0
  495. numpy/lib/_arraypad_impl.pyi +99 -0
  496. numpy/lib/_arraysetops_impl.py +1158 -0
  497. numpy/lib/_arraysetops_impl.pyi +460 -0
  498. numpy/lib/_arrayterator_impl.py +224 -0
  499. numpy/lib/_arrayterator_impl.pyi +45 -0
  500. numpy/lib/_datasource.py +700 -0
  501. numpy/lib/_datasource.pyi +30 -0
  502. numpy/lib/_format_impl.py +1038 -0
  503. numpy/lib/_format_impl.pyi +56 -0
  504. numpy/lib/_function_base_impl.py +5775 -0
  505. numpy/lib/_function_base_impl.pyi +2315 -0
  506. numpy/lib/_histograms_impl.py +1085 -0
  507. numpy/lib/_histograms_impl.pyi +273 -0
  508. numpy/lib/_index_tricks_impl.py +1048 -0
  509. numpy/lib/_index_tricks_impl.pyi +350 -0
  510. numpy/lib/_iotools.py +900 -0
  511. numpy/lib/_iotools.pyi +113 -0
  512. numpy/lib/_nanfunctions_impl.py +2006 -0
  513. numpy/lib/_nanfunctions_impl.pyi +48 -0
  514. numpy/lib/_npyio_impl.py +2491 -0
  515. numpy/lib/_npyio_impl.pyi +288 -0
  516. numpy/lib/_polynomial_impl.py +1467 -0
  517. numpy/lib/_polynomial_impl.pyi +435 -0
  518. numpy/lib/_scimath_impl.py +642 -0
  519. numpy/lib/_scimath_impl.pyi +93 -0
  520. numpy/lib/_shape_base_impl.py +1247 -0
  521. numpy/lib/_shape_base_impl.pyi +256 -0
  522. numpy/lib/_stride_tricks_impl.py +656 -0
  523. numpy/lib/_stride_tricks_impl.pyi +75 -0
  524. numpy/lib/_twodim_base_impl.py +1242 -0
  525. numpy/lib/_twodim_base_impl.pyi +397 -0
  526. numpy/lib/_type_check_impl.py +714 -0
  527. numpy/lib/_type_check_impl.pyi +450 -0
  528. numpy/lib/_ufunclike_impl.py +212 -0
  529. numpy/lib/_ufunclike_impl.pyi +41 -0
  530. numpy/lib/_user_array_impl.py +310 -0
  531. numpy/lib/_user_array_impl.pyi +229 -0
  532. numpy/lib/_utils_impl.py +541 -0
  533. numpy/lib/_utils_impl.pyi +18 -0
  534. numpy/lib/_version.py +153 -0
  535. numpy/lib/_version.pyi +22 -0
  536. numpy/lib/array_utils.py +7 -0
  537. numpy/lib/array_utils.pyi +6 -0
  538. numpy/lib/format.py +24 -0
  539. numpy/lib/format.pyi +24 -0
  540. numpy/lib/introspect.py +94 -0
  541. numpy/lib/introspect.pyi +3 -0
  542. numpy/lib/mixins.py +180 -0
  543. numpy/lib/mixins.pyi +78 -0
  544. numpy/lib/npyio.py +1 -0
  545. numpy/lib/npyio.pyi +5 -0
  546. numpy/lib/recfunctions.py +1681 -0
  547. numpy/lib/recfunctions.pyi +436 -0
  548. numpy/lib/scimath.py +13 -0
  549. numpy/lib/scimath.pyi +12 -0
  550. numpy/lib/stride_tricks.py +1 -0
  551. numpy/lib/stride_tricks.pyi +4 -0
  552. numpy/lib/tests/__init__.py +0 -0
  553. numpy/lib/tests/data/py2-np0-objarr.npy +0 -0
  554. numpy/lib/tests/data/py2-objarr.npy +0 -0
  555. numpy/lib/tests/data/py2-objarr.npz +0 -0
  556. numpy/lib/tests/data/py3-objarr.npy +0 -0
  557. numpy/lib/tests/data/py3-objarr.npz +0 -0
  558. numpy/lib/tests/data/python3.npy +0 -0
  559. numpy/lib/tests/data/win64python2.npy +0 -0
  560. numpy/lib/tests/test__datasource.py +328 -0
  561. numpy/lib/tests/test__iotools.py +358 -0
  562. numpy/lib/tests/test__version.py +64 -0
  563. numpy/lib/tests/test_array_utils.py +32 -0
  564. numpy/lib/tests/test_arraypad.py +1427 -0
  565. numpy/lib/tests/test_arraysetops.py +1304 -0
  566. numpy/lib/tests/test_arrayterator.py +45 -0
  567. numpy/lib/tests/test_format.py +1043 -0
  568. numpy/lib/tests/test_function_base.py +4787 -0
  569. numpy/lib/tests/test_histograms.py +855 -0
  570. numpy/lib/tests/test_index_tricks.py +703 -0
  571. numpy/lib/tests/test_io.py +2733 -0
  572. numpy/lib/tests/test_loadtxt.py +1077 -0
  573. numpy/lib/tests/test_mixins.py +215 -0
  574. numpy/lib/tests/test_nanfunctions.py +1449 -0
  575. numpy/lib/tests/test_packbits.py +374 -0
  576. numpy/lib/tests/test_polynomial.py +333 -0
  577. numpy/lib/tests/test_recfunctions.py +1042 -0
  578. numpy/lib/tests/test_regression.py +231 -0
  579. numpy/lib/tests/test_shape_base.py +813 -0
  580. numpy/lib/tests/test_stride_tricks.py +890 -0
  581. numpy/lib/tests/test_twodim_base.py +564 -0
  582. numpy/lib/tests/test_type_check.py +473 -0
  583. numpy/lib/tests/test_ufunclike.py +121 -0
  584. numpy/lib/tests/test_utils.py +80 -0
  585. numpy/lib/user_array.py +1 -0
  586. numpy/lib/user_array.pyi +1 -0
  587. numpy/linalg/__init__.py +95 -0
  588. numpy/linalg/__init__.pyi +71 -0
  589. numpy/linalg/_linalg.py +3649 -0
  590. numpy/linalg/_linalg.pyi +1230 -0
  591. numpy/linalg/_umath_linalg.cp315-win32.lib +0 -0
  592. numpy/linalg/_umath_linalg.cp315-win32.pyd +0 -0
  593. numpy/linalg/_umath_linalg.pyi +60 -0
  594. numpy/linalg/lapack_lite.cp315-win32.lib +0 -0
  595. numpy/linalg/lapack_lite.cp315-win32.pyd +0 -0
  596. numpy/linalg/lapack_lite.pyi +143 -0
  597. numpy/linalg/tests/__init__.py +0 -0
  598. numpy/linalg/tests/test_deprecations.py +21 -0
  599. numpy/linalg/tests/test_linalg.py +2492 -0
  600. numpy/linalg/tests/test_regression.py +191 -0
  601. numpy/ma/API_CHANGES.txt +135 -0
  602. numpy/ma/LICENSE +24 -0
  603. numpy/ma/README.rst +236 -0
  604. numpy/ma/__init__.py +53 -0
  605. numpy/ma/__init__.pyi +458 -0
  606. numpy/ma/core.py +9000 -0
  607. numpy/ma/core.pyi +4767 -0
  608. numpy/ma/extras.py +2266 -0
  609. numpy/ma/extras.pyi +770 -0
  610. numpy/ma/mrecords.py +739 -0
  611. numpy/ma/mrecords.pyi +313 -0
  612. numpy/ma/tests/__init__.py +0 -0
  613. numpy/ma/tests/test_arrayobject.py +40 -0
  614. numpy/ma/tests/test_core.py +6112 -0
  615. numpy/ma/tests/test_deprecations.py +73 -0
  616. numpy/ma/tests/test_extras.py +1945 -0
  617. numpy/ma/tests/test_mrecords.py +495 -0
  618. numpy/ma/tests/test_old_ma.py +939 -0
  619. numpy/ma/tests/test_regression.py +83 -0
  620. numpy/ma/tests/test_subclassing.py +469 -0
  621. numpy/ma/testutils.py +294 -0
  622. numpy/ma/testutils.pyi +69 -0
  623. numpy/matlib.py +380 -0
  624. numpy/matlib.pyi +580 -0
  625. numpy/matrixlib/__init__.py +12 -0
  626. numpy/matrixlib/__init__.pyi +3 -0
  627. numpy/matrixlib/defmatrix.py +1117 -0
  628. numpy/matrixlib/defmatrix.pyi +211 -0
  629. numpy/matrixlib/tests/__init__.py +0 -0
  630. numpy/matrixlib/tests/test_defmatrix.py +475 -0
  631. numpy/matrixlib/tests/test_interaction.py +360 -0
  632. numpy/matrixlib/tests/test_masked_matrix.py +240 -0
  633. numpy/matrixlib/tests/test_matrix_linalg.py +110 -0
  634. numpy/matrixlib/tests/test_multiarray.py +17 -0
  635. numpy/matrixlib/tests/test_numeric.py +18 -0
  636. numpy/matrixlib/tests/test_regression.py +31 -0
  637. numpy/polynomial/__init__.py +187 -0
  638. numpy/polynomial/__init__.pyi +31 -0
  639. numpy/polynomial/_polybase.py +1191 -0
  640. numpy/polynomial/_polybase.pyi +255 -0
  641. numpy/polynomial/_polytypes.pyi +536 -0
  642. numpy/polynomial/chebyshev.py +2053 -0
  643. numpy/polynomial/chebyshev.pyi +173 -0
  644. numpy/polynomial/hermite.py +1794 -0
  645. numpy/polynomial/hermite.pyi +110 -0
  646. numpy/polynomial/hermite_e.py +1692 -0
  647. numpy/polynomial/hermite_e.pyi +110 -0
  648. numpy/polynomial/laguerre.py +1729 -0
  649. numpy/polynomial/laguerre.pyi +103 -0
  650. numpy/polynomial/legendre.py +1655 -0
  651. numpy/polynomial/legendre.pyi +103 -0
  652. numpy/polynomial/polynomial.py +1683 -0
  653. numpy/polynomial/polynomial.pyi +112 -0
  654. numpy/polynomial/polyutils.py +759 -0
  655. numpy/polynomial/polyutils.pyi +295 -0
  656. numpy/polynomial/tests/__init__.py +0 -0
  657. numpy/polynomial/tests/test_chebyshev.py +639 -0
  658. numpy/polynomial/tests/test_classes.py +625 -0
  659. numpy/polynomial/tests/test_hermite.py +574 -0
  660. numpy/polynomial/tests/test_hermite_e.py +575 -0
  661. numpy/polynomial/tests/test_laguerre.py +556 -0
  662. numpy/polynomial/tests/test_legendre.py +587 -0
  663. numpy/polynomial/tests/test_polynomial.py +713 -0
  664. numpy/polynomial/tests/test_polyutils.py +123 -0
  665. numpy/polynomial/tests/test_printing.py +562 -0
  666. numpy/polynomial/tests/test_symbol.py +217 -0
  667. numpy/py.typed +0 -0
  668. numpy/random/LICENSE.md +71 -0
  669. numpy/random/__init__.pxd +14 -0
  670. numpy/random/__init__.py +213 -0
  671. numpy/random/__init__.pyi +124 -0
  672. numpy/random/_bounded_integers.cp315-win32.lib +0 -0
  673. numpy/random/_bounded_integers.cp315-win32.pyd +0 -0
  674. numpy/random/_bounded_integers.pxd +38 -0
  675. numpy/random/_bounded_integers.pyi +1 -0
  676. numpy/random/_common.cp315-win32.lib +0 -0
  677. numpy/random/_common.cp315-win32.pyd +0 -0
  678. numpy/random/_common.pxd +110 -0
  679. numpy/random/_common.pyi +17 -0
  680. numpy/random/_examples/cffi/extending.py +44 -0
  681. numpy/random/_examples/cffi/parse.py +53 -0
  682. numpy/random/_examples/cython/extending.pyx +77 -0
  683. numpy/random/_examples/cython/extending_distributions.pyx +117 -0
  684. numpy/random/_examples/cython/meson.build +53 -0
  685. numpy/random/_examples/numba/extending.py +86 -0
  686. numpy/random/_examples/numba/extending_distributions.py +67 -0
  687. numpy/random/_generator.cp315-win32.lib +0 -0
  688. numpy/random/_generator.cp315-win32.pyd +0 -0
  689. numpy/random/_generator.pyi +769 -0
  690. numpy/random/_mt19937.cp315-win32.lib +0 -0
  691. numpy/random/_mt19937.cp315-win32.pyd +0 -0
  692. numpy/random/_mt19937.pyi +27 -0
  693. numpy/random/_pcg64.cp315-win32.lib +0 -0
  694. numpy/random/_pcg64.cp315-win32.pyd +0 -0
  695. numpy/random/_pcg64.pyi +36 -0
  696. numpy/random/_philox.cp315-win32.lib +0 -0
  697. numpy/random/_philox.cp315-win32.pyd +0 -0
  698. numpy/random/_philox.pyi +36 -0
  699. numpy/random/_pickle.py +88 -0
  700. numpy/random/_pickle.pyi +43 -0
  701. numpy/random/_sfc64.cp315-win32.lib +0 -0
  702. numpy/random/_sfc64.cp315-win32.pyd +0 -0
  703. numpy/random/_sfc64.pyi +25 -0
  704. numpy/random/bit_generator.cp315-win32.lib +0 -0
  705. numpy/random/bit_generator.cp315-win32.pyd +0 -0
  706. numpy/random/bit_generator.pxd +35 -0
  707. numpy/random/bit_generator.pyi +122 -0
  708. numpy/random/c_distributions.pxd +119 -0
  709. numpy/random/lib/npyrandom.lib +0 -0
  710. numpy/random/mtrand.cp315-win32.lib +0 -0
  711. numpy/random/mtrand.cp315-win32.pyd +0 -0
  712. numpy/random/mtrand.pyi +996 -0
  713. numpy/random/tests/__init__.py +0 -0
  714. numpy/random/tests/data/__init__.py +0 -0
  715. numpy/random/tests/data/generator_pcg64_np121.pkl.gz +0 -0
  716. numpy/random/tests/data/generator_pcg64_np126.pkl.gz +0 -0
  717. numpy/random/tests/data/mt19937-testset-1.csv +1001 -0
  718. numpy/random/tests/data/mt19937-testset-2.csv +1001 -0
  719. numpy/random/tests/data/pcg64-testset-1.csv +1001 -0
  720. numpy/random/tests/data/pcg64-testset-2.csv +1001 -0
  721. numpy/random/tests/data/pcg64dxsm-testset-1.csv +1001 -0
  722. numpy/random/tests/data/pcg64dxsm-testset-2.csv +1001 -0
  723. numpy/random/tests/data/philox-testset-1.csv +1001 -0
  724. numpy/random/tests/data/philox-testset-2.csv +1001 -0
  725. numpy/random/tests/data/sfc64-testset-1.csv +1001 -0
  726. numpy/random/tests/data/sfc64-testset-2.csv +1001 -0
  727. numpy/random/tests/data/sfc64_np126.pkl.gz +0 -0
  728. numpy/random/tests/test_direct.py +620 -0
  729. numpy/random/tests/test_extending.py +129 -0
  730. numpy/random/tests/test_generator_mt19937.py +2830 -0
  731. numpy/random/tests/test_generator_mt19937_regressions.py +240 -0
  732. numpy/random/tests/test_random.py +1723 -0
  733. numpy/random/tests/test_randomstate.py +2107 -0
  734. numpy/random/tests/test_randomstate_regression.py +249 -0
  735. numpy/random/tests/test_regression.py +174 -0
  736. numpy/random/tests/test_seed_sequence.py +103 -0
  737. numpy/random/tests/test_smoke.py +882 -0
  738. numpy/rec/__init__.py +2 -0
  739. numpy/rec/__init__.pyi +23 -0
  740. numpy/strings/__init__.py +2 -0
  741. numpy/strings/__init__.pyi +97 -0
  742. numpy/testing/__init__.py +22 -0
  743. numpy/testing/__init__.pyi +107 -0
  744. numpy/testing/_private/__init__.py +0 -0
  745. numpy/testing/_private/__init__.pyi +0 -0
  746. numpy/testing/_private/extbuild.py +247 -0
  747. numpy/testing/_private/extbuild.pyi +25 -0
  748. numpy/testing/_private/utils.py +2899 -0
  749. numpy/testing/_private/utils.pyi +501 -0
  750. numpy/testing/overrides.py +84 -0
  751. numpy/testing/overrides.pyi +10 -0
  752. numpy/testing/print_coercion_tables.py +207 -0
  753. numpy/testing/print_coercion_tables.pyi +26 -0
  754. numpy/testing/tests/__init__.py +0 -0
  755. numpy/testing/tests/test_utils.py +2147 -0
  756. numpy/tests/__init__.py +0 -0
  757. numpy/tests/test__all__.py +10 -0
  758. numpy/tests/test_configtool.py +51 -0
  759. numpy/tests/test_ctypeslib.py +406 -0
  760. numpy/tests/test_lazyloading.py +35 -0
  761. numpy/tests/test_matlib.py +59 -0
  762. numpy/tests/test_numpy_config.py +47 -0
  763. numpy/tests/test_numpy_version.py +54 -0
  764. numpy/tests/test_public_api.py +723 -0
  765. numpy/tests/test_reloading.py +69 -0
  766. numpy/tests/test_scripts.py +45 -0
  767. numpy/tests/test_warnings.py +81 -0
  768. numpy/typing/__init__.py +225 -0
  769. numpy/typing/__init__.pyi +8 -0
  770. numpy/typing/mypy_plugin.py +200 -0
  771. numpy/typing/tests/__init__.py +0 -0
  772. numpy/typing/tests/data/fail/arithmetic.pyi +126 -0
  773. numpy/typing/tests/data/fail/array_constructors.pyi +34 -0
  774. numpy/typing/tests/data/fail/array_like.pyi +15 -0
  775. numpy/typing/tests/data/fail/array_pad.pyi +6 -0
  776. numpy/typing/tests/data/fail/arrayprint.pyi +15 -0
  777. numpy/typing/tests/data/fail/arrayterator.pyi +14 -0
  778. numpy/typing/tests/data/fail/bitwise_ops.pyi +17 -0
  779. numpy/typing/tests/data/fail/char.pyi +60 -0
  780. numpy/typing/tests/data/fail/chararray.pyi +61 -0
  781. numpy/typing/tests/data/fail/comparisons.pyi +27 -0
  782. numpy/typing/tests/data/fail/constants.pyi +3 -0
  783. numpy/typing/tests/data/fail/datasource.pyi +16 -0
  784. numpy/typing/tests/data/fail/dtype.pyi +17 -0
  785. numpy/typing/tests/data/fail/einsumfunc.pyi +12 -0
  786. numpy/typing/tests/data/fail/flatiter.pyi +38 -0
  787. numpy/typing/tests/data/fail/fromnumeric.pyi +149 -0
  788. numpy/typing/tests/data/fail/histograms.pyi +12 -0
  789. numpy/typing/tests/data/fail/index_tricks.pyi +14 -0
  790. numpy/typing/tests/data/fail/lib_function_base.pyi +60 -0
  791. numpy/typing/tests/data/fail/lib_polynomial.pyi +29 -0
  792. numpy/typing/tests/data/fail/lib_utils.pyi +3 -0
  793. numpy/typing/tests/data/fail/lib_version.pyi +6 -0
  794. numpy/typing/tests/data/fail/linalg.pyi +48 -0
  795. numpy/typing/tests/data/fail/ma.pyi +152 -0
  796. numpy/typing/tests/data/fail/memmap.pyi +5 -0
  797. numpy/typing/tests/data/fail/modules.pyi +17 -0
  798. numpy/typing/tests/data/fail/multiarray.pyi +52 -0
  799. numpy/typing/tests/data/fail/ndarray.pyi +11 -0
  800. numpy/typing/tests/data/fail/ndarray_misc.pyi +49 -0
  801. numpy/typing/tests/data/fail/nditer.pyi +7 -0
  802. numpy/typing/tests/data/fail/nested_sequence.pyi +17 -0
  803. numpy/typing/tests/data/fail/npyio.pyi +24 -0
  804. numpy/typing/tests/data/fail/numerictypes.pyi +5 -0
  805. numpy/typing/tests/data/fail/random.pyi +62 -0
  806. numpy/typing/tests/data/fail/rec.pyi +17 -0
  807. numpy/typing/tests/data/fail/scalars.pyi +86 -0
  808. numpy/typing/tests/data/fail/shape.pyi +7 -0
  809. numpy/typing/tests/data/fail/shape_base.pyi +8 -0
  810. numpy/typing/tests/data/fail/stride_tricks.pyi +9 -0
  811. numpy/typing/tests/data/fail/strings.pyi +41 -0
  812. numpy/typing/tests/data/fail/testing.pyi +28 -0
  813. numpy/typing/tests/data/fail/twodim_base.pyi +39 -0
  814. numpy/typing/tests/data/fail/type_check.pyi +13 -0
  815. numpy/typing/tests/data/fail/ufunc_config.pyi +21 -0
  816. numpy/typing/tests/data/fail/ufunclike.pyi +21 -0
  817. numpy/typing/tests/data/fail/ufuncs.pyi +17 -0
  818. numpy/typing/tests/data/fail/warnings_and_errors.pyi +5 -0
  819. numpy/typing/tests/data/misc/extended_precision.pyi +9 -0
  820. numpy/typing/tests/data/mypy.ini +8 -0
  821. numpy/typing/tests/data/pass/arithmetic.py +614 -0
  822. numpy/typing/tests/data/pass/array_constructors.py +137 -0
  823. numpy/typing/tests/data/pass/array_like.py +37 -0
  824. numpy/typing/tests/data/pass/arrayprint.py +37 -0
  825. numpy/typing/tests/data/pass/arrayterator.py +28 -0
  826. numpy/typing/tests/data/pass/bitwise_ops.py +131 -0
  827. numpy/typing/tests/data/pass/comparisons.py +316 -0
  828. numpy/typing/tests/data/pass/dtype.py +57 -0
  829. numpy/typing/tests/data/pass/einsumfunc.py +36 -0
  830. numpy/typing/tests/data/pass/flatiter.py +26 -0
  831. numpy/typing/tests/data/pass/fromnumeric.py +272 -0
  832. numpy/typing/tests/data/pass/index_tricks.py +62 -0
  833. numpy/typing/tests/data/pass/lib_user_array.py +22 -0
  834. numpy/typing/tests/data/pass/lib_utils.py +19 -0
  835. numpy/typing/tests/data/pass/lib_version.py +18 -0
  836. numpy/typing/tests/data/pass/literal.py +52 -0
  837. numpy/typing/tests/data/pass/ma.py +199 -0
  838. numpy/typing/tests/data/pass/mod.py +149 -0
  839. numpy/typing/tests/data/pass/modules.py +45 -0
  840. numpy/typing/tests/data/pass/multiarray.py +77 -0
  841. numpy/typing/tests/data/pass/ndarray_conversion.py +81 -0
  842. numpy/typing/tests/data/pass/ndarray_misc.py +199 -0
  843. numpy/typing/tests/data/pass/ndarray_shape_manipulation.py +47 -0
  844. numpy/typing/tests/data/pass/nditer.py +4 -0
  845. numpy/typing/tests/data/pass/numeric.py +90 -0
  846. numpy/typing/tests/data/pass/numerictypes.py +17 -0
  847. numpy/typing/tests/data/pass/random.py +1498 -0
  848. numpy/typing/tests/data/pass/recfunctions.py +164 -0
  849. numpy/typing/tests/data/pass/scalars.py +262 -0
  850. numpy/typing/tests/data/pass/shape.py +19 -0
  851. numpy/typing/tests/data/pass/simple.py +170 -0
  852. numpy/typing/tests/data/pass/ufunc_config.py +64 -0
  853. numpy/typing/tests/data/pass/ufunclike.py +52 -0
  854. numpy/typing/tests/data/pass/ufuncs.py +16 -0
  855. numpy/typing/tests/data/pass/warnings_and_errors.py +6 -0
  856. numpy/typing/tests/data/reveal/arithmetic.pyi +726 -0
  857. numpy/typing/tests/data/reveal/array_api_info.pyi +70 -0
  858. numpy/typing/tests/data/reveal/array_constructors.pyi +331 -0
  859. numpy/typing/tests/data/reveal/arraypad.pyi +32 -0
  860. numpy/typing/tests/data/reveal/arrayprint.pyi +25 -0
  861. numpy/typing/tests/data/reveal/arraysetops.pyi +80 -0
  862. numpy/typing/tests/data/reveal/arrayterator.pyi +27 -0
  863. numpy/typing/tests/data/reveal/bitwise_ops.pyi +166 -0
  864. numpy/typing/tests/data/reveal/char.pyi +228 -0
  865. numpy/typing/tests/data/reveal/chararray.pyi +138 -0
  866. numpy/typing/tests/data/reveal/comparisons.pyi +264 -0
  867. numpy/typing/tests/data/reveal/constants.pyi +14 -0
  868. numpy/typing/tests/data/reveal/ctypeslib.pyi +86 -0
  869. numpy/typing/tests/data/reveal/datasource.pyi +23 -0
  870. numpy/typing/tests/data/reveal/dtype.pyi +166 -0
  871. numpy/typing/tests/data/reveal/einsumfunc.pyi +46 -0
  872. numpy/typing/tests/data/reveal/emath.pyi +54 -0
  873. numpy/typing/tests/data/reveal/fft.pyi +189 -0
  874. numpy/typing/tests/data/reveal/flatiter.pyi +86 -0
  875. numpy/typing/tests/data/reveal/fromnumeric.pyi +574 -0
  876. numpy/typing/tests/data/reveal/getlimits.pyi +53 -0
  877. numpy/typing/tests/data/reveal/histograms.pyi +69 -0
  878. numpy/typing/tests/data/reveal/index_tricks.pyi +148 -0
  879. numpy/typing/tests/data/reveal/lib_function_base.pyi +413 -0
  880. numpy/typing/tests/data/reveal/lib_polynomial.pyi +147 -0
  881. numpy/typing/tests/data/reveal/lib_utils.pyi +17 -0
  882. numpy/typing/tests/data/reveal/lib_version.pyi +20 -0
  883. numpy/typing/tests/data/reveal/linalg.pyi +517 -0
  884. numpy/typing/tests/data/reveal/ma.pyi +1103 -0
  885. numpy/typing/tests/data/reveal/matrix.pyi +73 -0
  886. numpy/typing/tests/data/reveal/memmap.pyi +21 -0
  887. numpy/typing/tests/data/reveal/mod.pyi +179 -0
  888. numpy/typing/tests/data/reveal/modules.pyi +51 -0
  889. numpy/typing/tests/data/reveal/multiarray.pyi +336 -0
  890. numpy/typing/tests/data/reveal/nbit_base_example.pyi +17 -0
  891. numpy/typing/tests/data/reveal/ndarray_assignability.pyi +79 -0
  892. numpy/typing/tests/data/reveal/ndarray_conversion.pyi +83 -0
  893. numpy/typing/tests/data/reveal/ndarray_misc.pyi +428 -0
  894. numpy/typing/tests/data/reveal/ndarray_shape_manipulation.pyi +47 -0
  895. numpy/typing/tests/data/reveal/nditer.pyi +49 -0
  896. numpy/typing/tests/data/reveal/nested_sequence.pyi +25 -0
  897. numpy/typing/tests/data/reveal/npyio.pyi +85 -0
  898. numpy/typing/tests/data/reveal/numeric.pyi +176 -0
  899. numpy/typing/tests/data/reveal/numerictypes.pyi +16 -0
  900. numpy/typing/tests/data/reveal/polynomial_polybase.pyi +216 -0
  901. numpy/typing/tests/data/reveal/polynomial_polyutils.pyi +218 -0
  902. numpy/typing/tests/data/reveal/polynomial_series.pyi +138 -0
  903. numpy/typing/tests/data/reveal/random.pyi +1357 -0
  904. numpy/typing/tests/data/reveal/rec.pyi +177 -0
  905. numpy/typing/tests/data/reveal/scalars.pyi +288 -0
  906. numpy/typing/tests/data/reveal/shape.pyi +13 -0
  907. numpy/typing/tests/data/reveal/shape_base.pyi +84 -0
  908. numpy/typing/tests/data/reveal/stride_tricks.pyi +27 -0
  909. numpy/typing/tests/data/reveal/strings.pyi +198 -0
  910. numpy/typing/tests/data/reveal/testing.pyi +196 -0
  911. numpy/typing/tests/data/reveal/twodim_base.pyi +231 -0
  912. numpy/typing/tests/data/reveal/type_check.pyi +94 -0
  913. numpy/typing/tests/data/reveal/ufunc_config.pyi +30 -0
  914. numpy/typing/tests/data/reveal/ufunclike.pyi +31 -0
  915. numpy/typing/tests/data/reveal/ufuncs.pyi +142 -0
  916. numpy/typing/tests/data/reveal/warnings_and_errors.pyi +11 -0
  917. numpy/typing/tests/test_isfile.py +35 -0
  918. numpy/typing/tests/test_runtime.py +103 -0
  919. numpy/typing/tests/test_typing.py +207 -0
  920. numpy/version.py +11 -0
  921. numpy/version.pyi +9 -0
  922. numpy-2.5.2.dist-info/METADATA +139 -0
  923. numpy-2.5.2.dist-info/RECORD +942 -0
  924. numpy-2.5.2.dist-info/WHEEL +4 -0
  925. numpy-2.5.2.dist-info/entry_points.txt +13 -0
  926. numpy-2.5.2.dist-info/licenses/LICENSE.txt +914 -0
  927. numpy-2.5.2.dist-info/licenses/numpy/_core/include/numpy/libdivide/LICENSE.txt +21 -0
  928. numpy-2.5.2.dist-info/licenses/numpy/_core/src/common/pythoncapi-compat/COPYING +14 -0
  929. numpy-2.5.2.dist-info/licenses/numpy/_core/src/highway/LICENSE +371 -0
  930. numpy-2.5.2.dist-info/licenses/numpy/_core/src/multiarray/dragon4_LICENSE.txt +27 -0
  931. numpy-2.5.2.dist-info/licenses/numpy/_core/src/npysort/x86-simd-sort/LICENSE.md +28 -0
  932. numpy-2.5.2.dist-info/licenses/numpy/_core/src/umath/svml/LICENSE +30 -0
  933. numpy-2.5.2.dist-info/licenses/numpy/fft/pocketfft/LICENSE.md +25 -0
  934. numpy-2.5.2.dist-info/licenses/numpy/linalg/lapack_lite/LICENSE.txt +48 -0
  935. numpy-2.5.2.dist-info/licenses/numpy/ma/LICENSE +24 -0
  936. numpy-2.5.2.dist-info/licenses/numpy/random/LICENSE.md +71 -0
  937. numpy-2.5.2.dist-info/licenses/numpy/random/src/distributions/LICENSE.md +61 -0
  938. numpy-2.5.2.dist-info/licenses/numpy/random/src/mt19937/LICENSE.md +61 -0
  939. numpy-2.5.2.dist-info/licenses/numpy/random/src/pcg64/LICENSE.md +22 -0
  940. numpy-2.5.2.dist-info/licenses/numpy/random/src/philox/LICENSE.md +31 -0
  941. numpy-2.5.2.dist-info/licenses/numpy/random/src/sfc64/LICENSE.md +27 -0
  942. numpy-2.5.2.dist-info/licenses/numpy/random/src/splitmix64/LICENSE.md +9 -0
@@ -0,0 +1,3144 @@
1
+ from _typeshed import SupportsBool
2
+ from collections.abc import Sequence
3
+ from typing import (
4
+ Any,
5
+ Literal,
6
+ Never,
7
+ Protocol,
8
+ SupportsIndex,
9
+ TypedDict,
10
+ Unpack,
11
+ overload,
12
+ type_check_only,
13
+ )
14
+
15
+ import numpy as np
16
+ from numpy import (
17
+ _CastingKind,
18
+ _ModeKind,
19
+ _OrderACF,
20
+ _OrderKACF,
21
+ _PartitionKind,
22
+ _SortKind,
23
+ _SortSide,
24
+ float16,
25
+ intp,
26
+ object_,
27
+ )
28
+ from numpy._globals import _NoValueType
29
+ from numpy._typing import (
30
+ ArrayLike,
31
+ DTypeLike,
32
+ NDArray,
33
+ _AnyShape,
34
+ _ArrayLike,
35
+ _ArrayLikeBool_co,
36
+ _ArrayLikeComplex_co,
37
+ _ArrayLikeFloat_co,
38
+ _ArrayLikeInt,
39
+ _ArrayLikeInt_co,
40
+ _ArrayLikeObject_co,
41
+ _BoolLike_co,
42
+ _ComplexLike_co,
43
+ _DTypeLike,
44
+ _FloatLike_co,
45
+ _IntLike_co,
46
+ _NestedSequence,
47
+ _NumberLike_co,
48
+ _ScalarLike_co,
49
+ _Shape,
50
+ _ShapeLike,
51
+ _SupportsArray,
52
+ )
53
+ from numpy._typing._array_like import _DualArrayLike
54
+
55
+ __all__ = [
56
+ "all",
57
+ "amax",
58
+ "amin",
59
+ "any",
60
+ "argmax",
61
+ "argmin",
62
+ "argpartition",
63
+ "argsort",
64
+ "around",
65
+ "choose",
66
+ "clip",
67
+ "compress",
68
+ "cumprod",
69
+ "cumsum",
70
+ "cumulative_prod",
71
+ "cumulative_sum",
72
+ "diagonal",
73
+ "mean",
74
+ "max",
75
+ "min",
76
+ "matrix_transpose",
77
+ "ndim",
78
+ "nonzero",
79
+ "partition",
80
+ "prod",
81
+ "ptp",
82
+ "put",
83
+ "ravel",
84
+ "repeat",
85
+ "reshape",
86
+ "resize",
87
+ "round",
88
+ "searchsorted",
89
+ "shape",
90
+ "size",
91
+ "sort",
92
+ "squeeze",
93
+ "std",
94
+ "sum",
95
+ "swapaxes",
96
+ "take",
97
+ "trace",
98
+ "transpose",
99
+ "var",
100
+ ]
101
+
102
+ @type_check_only
103
+ class _SupportsShape[ShapeT_co: _Shape](Protocol):
104
+ # NOTE: it matters that `self` is positional only
105
+ @property
106
+ def shape(self, /) -> ShapeT_co: ...
107
+
108
+ @type_check_only
109
+ class _UFuncKwargs(TypedDict, total=False):
110
+ where: _ArrayLikeBool_co | None
111
+ order: _OrderKACF
112
+ subok: bool
113
+ signature: str | tuple[str | None, ...]
114
+ casting: _CastingKind
115
+
116
+ # a "sequence" that isn't a string, bytes, bytearray, or memoryview
117
+ type _PyArray[_T] = list[_T] | tuple[_T, ...]
118
+ # `int` also covers `bool`
119
+ type _PyScalar = complex | bytes | str
120
+
121
+ type _0D = tuple[()]
122
+ type _1D = tuple[int]
123
+ type _2D = tuple[int, int]
124
+ type _3D = tuple[int, int, int]
125
+ type _4D = tuple[int, int, int, int]
126
+
127
+ type _Array1D[ScalarT: np.generic] = np.ndarray[_1D, np.dtype[ScalarT]]
128
+ type _Array2D[ScalarT: np.generic] = np.ndarray[_2D, np.dtype[ScalarT]]
129
+ type _Array3D[ScalarT: np.generic] = np.ndarray[_3D, np.dtype[ScalarT]]
130
+ # workaround for mypy's and pyright's typing spec non-compliance regarding overloads
131
+ type _ArrayJustND[ScalarT: np.generic] = np.ndarray[tuple[Never, Never, Never, Never], np.dtype[ScalarT]]
132
+
133
+ type _ToArray1D[ScalarT: np.generic] = _Array1D[ScalarT] | Sequence[ScalarT]
134
+ type _ToArray2D[ScalarT: np.generic] = _Array2D[ScalarT] | Sequence[Sequence[ScalarT]]
135
+ type _ToArray3D[ScalarT: np.generic] = _Array3D[ScalarT] | Sequence[Sequence[Sequence[ScalarT]]]
136
+
137
+ type _ArrayLikeMultiplicative_co = _DualArrayLike[np.dtype[np.number | np.bool | np.object_], complex]
138
+ type _ArrayLikeNumeric_co = _DualArrayLike[np.dtype[np.number | np.bool | np.object_ | np.timedelta64], complex]
139
+
140
+ @type_check_only
141
+ class _CanLE(Protocol):
142
+ def __le__(self, other: Any, /) -> SupportsBool: ...
143
+
144
+ @type_check_only
145
+ class _CanGE(Protocol):
146
+ def __ge__(self, other: Any, /) -> SupportsBool: ...
147
+
148
+ type _Orderable = _CanLE | _CanGE
149
+
150
+ ###
151
+
152
+ # TODO: Fix overlapping overloads: https://github.com/numpy/numpy/issues/27032
153
+ @overload
154
+ def take[ScalarT: np.generic](
155
+ a: _ArrayLike[ScalarT],
156
+ indices: _IntLike_co,
157
+ axis: None = None,
158
+ out: None = None,
159
+ mode: _ModeKind = "raise",
160
+ ) -> ScalarT: ...
161
+ @overload
162
+ def take(
163
+ a: ArrayLike,
164
+ indices: _IntLike_co,
165
+ axis: SupportsIndex | None = None,
166
+ out: None = None,
167
+ mode: _ModeKind = "raise",
168
+ ) -> Any: ...
169
+ @overload
170
+ def take[ScalarT: np.generic](
171
+ a: _ArrayLike[ScalarT],
172
+ indices: _ArrayLikeInt_co,
173
+ axis: SupportsIndex | None = None,
174
+ out: None = None,
175
+ mode: _ModeKind = "raise",
176
+ ) -> NDArray[ScalarT]: ...
177
+ @overload
178
+ def take(
179
+ a: ArrayLike,
180
+ indices: _ArrayLikeInt_co,
181
+ axis: SupportsIndex | None = None,
182
+ out: None = None,
183
+ mode: _ModeKind = "raise",
184
+ ) -> NDArray[Any]: ...
185
+ @overload
186
+ def take[ArrayT: np.ndarray](
187
+ a: ArrayLike,
188
+ indices: _ArrayLikeInt_co,
189
+ axis: SupportsIndex | None,
190
+ out: ArrayT,
191
+ mode: _ModeKind = "raise",
192
+ ) -> ArrayT: ...
193
+ @overload
194
+ def take[ArrayT: np.ndarray](
195
+ a: ArrayLike,
196
+ indices: _ArrayLikeInt_co,
197
+ axis: SupportsIndex | None = None,
198
+ *,
199
+ out: ArrayT,
200
+ mode: _ModeKind = "raise",
201
+ ) -> ArrayT: ...
202
+
203
+ # keep in sync with `ma.core.reshape`
204
+ @overload # shape: index
205
+ def reshape[ScalarT: np.generic](
206
+ a: _ArrayLike[ScalarT],
207
+ /,
208
+ shape: SupportsIndex,
209
+ order: _OrderACF = "C",
210
+ *,
211
+ copy: bool | None = None,
212
+ ) -> _Array1D[ScalarT]: ...
213
+ @overload # shape: ~ShapeT
214
+ def reshape[ScalarT: np.generic, ShapeT: _Shape](
215
+ a: _ArrayLike[ScalarT],
216
+ /,
217
+ shape: ShapeT,
218
+ order: _OrderACF = "C",
219
+ *,
220
+ copy: bool | None = None,
221
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
222
+ @overload # shape: Sequence[index]
223
+ def reshape[ScalarT: np.generic](
224
+ a: _ArrayLike[ScalarT],
225
+ /,
226
+ shape: Sequence[SupportsIndex],
227
+ order: _OrderACF = "C",
228
+ *,
229
+ copy: bool | None = None,
230
+ ) -> NDArray[ScalarT]: ...
231
+ @overload # shape: index
232
+ def reshape(
233
+ a: ArrayLike,
234
+ /,
235
+ shape: SupportsIndex,
236
+ order: _OrderACF = "C",
237
+ *,
238
+ copy: bool | None = None,
239
+ ) -> np.ndarray[_1D]: ...
240
+ @overload # shape: ~ShapeT
241
+ def reshape[ShapeT: _Shape](
242
+ a: ArrayLike,
243
+ /,
244
+ shape: ShapeT,
245
+ order: _OrderACF = "C",
246
+ *,
247
+ copy: bool | None = None,
248
+ ) -> np.ndarray[ShapeT]: ...
249
+ @overload # shape: Sequence[index]
250
+ def reshape(
251
+ a: ArrayLike,
252
+ /,
253
+ shape: Sequence[SupportsIndex],
254
+ order: _OrderACF = "C",
255
+ *,
256
+ copy: bool | None = None,
257
+ ) -> NDArray[Any]: ...
258
+
259
+ # keep in sync with `ma.core.choose`
260
+ @overload
261
+ def choose(
262
+ a: _IntLike_co,
263
+ choices: ArrayLike,
264
+ out: None = None,
265
+ mode: _ModeKind = "raise",
266
+ ) -> Any: ...
267
+ @overload
268
+ def choose[ScalarT: np.generic](
269
+ a: _ArrayLikeInt_co,
270
+ choices: _ArrayLike[ScalarT],
271
+ out: None = None,
272
+ mode: _ModeKind = "raise",
273
+ ) -> NDArray[ScalarT]: ...
274
+ @overload
275
+ def choose(
276
+ a: _ArrayLikeInt_co,
277
+ choices: ArrayLike,
278
+ out: None = None,
279
+ mode: _ModeKind = "raise",
280
+ ) -> NDArray[Any]: ...
281
+ @overload
282
+ def choose[ArrayT: np.ndarray](
283
+ a: _ArrayLikeInt_co,
284
+ choices: ArrayLike,
285
+ out: ArrayT,
286
+ mode: _ModeKind = "raise",
287
+ ) -> ArrayT: ...
288
+
289
+ # keep in sync with `ma.core.repeat`
290
+ @overload
291
+ def repeat[ScalarT: np.generic](
292
+ a: _ArrayLike[ScalarT],
293
+ repeats: _ArrayLikeInt_co,
294
+ axis: None = None,
295
+ ) -> _Array1D[ScalarT]: ...
296
+ @overload
297
+ def repeat[ScalarT: np.generic](
298
+ a: _ArrayLike[ScalarT],
299
+ repeats: _ArrayLikeInt_co,
300
+ axis: SupportsIndex,
301
+ ) -> NDArray[ScalarT]: ...
302
+ @overload
303
+ def repeat(
304
+ a: ArrayLike,
305
+ repeats: _ArrayLikeInt_co,
306
+ axis: None = None,
307
+ ) -> _Array1D[Any]: ...
308
+ @overload
309
+ def repeat(
310
+ a: ArrayLike,
311
+ repeats: _ArrayLikeInt_co,
312
+ axis: SupportsIndex,
313
+ ) -> NDArray[Any]: ...
314
+
315
+ # keep in sync with `ma.core.put`
316
+ def put(
317
+ a: NDArray[Any],
318
+ ind: _ArrayLikeInt_co,
319
+ v: ArrayLike,
320
+ mode: _ModeKind = "raise",
321
+ ) -> None: ...
322
+
323
+ # keep in sync with `ndarray.swapaxes` and `ma.core.swapaxes`
324
+ @overload
325
+ def swapaxes[ArrayT: np.ndarray](a: ArrayT, axis1: SupportsIndex, axis2: SupportsIndex) -> ArrayT: ...
326
+ @overload
327
+ def swapaxes[ScalarT: np.generic](a: _ArrayLike[ScalarT], axis1: SupportsIndex, axis2: SupportsIndex) -> NDArray[ScalarT]: ...
328
+ @overload
329
+ def swapaxes(a: ArrayLike, axis1: SupportsIndex, axis2: SupportsIndex) -> NDArray[Any]: ...
330
+
331
+ #
332
+ @overload
333
+ def transpose[ArrayT: np.ndarray](a: ArrayT, axes: _ShapeLike | None = None) -> ArrayT: ...
334
+ @overload
335
+ def transpose[ScalarT: np.generic](a: _ArrayLike[ScalarT], axes: _ShapeLike | None = None) -> NDArray[ScalarT]: ...
336
+ @overload
337
+ def transpose(a: ArrayLike, axes: _ShapeLike | None = None) -> NDArray[Any]: ...
338
+
339
+ #
340
+ @overload
341
+ def matrix_transpose[ArrayT: np.ndarray](x: ArrayT, /) -> ArrayT: ...
342
+ @overload
343
+ def matrix_transpose[ScalarT: np.generic](x: _ArrayLike[ScalarT], /) -> NDArray[ScalarT]: ...
344
+ @overload
345
+ def matrix_transpose(x: ArrayLike, /) -> NDArray[Any]: ...
346
+
347
+ #
348
+ @overload # Nd
349
+ def partition[ArrayT: np.ndarray](
350
+ a: ArrayT,
351
+ kth: _ArrayLikeInt,
352
+ axis: SupportsIndex = -1,
353
+ kind: _PartitionKind = "introselect",
354
+ order: str | Sequence[str] | None = None,
355
+ ) -> ArrayT: ...
356
+ @overload # ?d
357
+ def partition[ScalarT: np.generic](
358
+ a: _ArrayLike[ScalarT],
359
+ kth: _ArrayLikeInt,
360
+ axis: SupportsIndex = -1,
361
+ kind: _PartitionKind = "introselect",
362
+ order: str | Sequence[str] | None = None,
363
+ ) -> NDArray[ScalarT]: ...
364
+ @overload # axis: None
365
+ def partition[ScalarT: np.generic](
366
+ a: _ArrayLike[ScalarT],
367
+ kth: _ArrayLikeInt,
368
+ axis: None,
369
+ kind: _PartitionKind = "introselect",
370
+ order: str | Sequence[str] | None = None,
371
+ ) -> _Array1D[ScalarT]: ...
372
+ @overload # fallback
373
+ def partition(
374
+ a: ArrayLike,
375
+ kth: _ArrayLikeInt,
376
+ axis: SupportsIndex = -1,
377
+ kind: _PartitionKind = "introselect",
378
+ order: str | Sequence[str] | None = None,
379
+ ) -> NDArray[Any]: ...
380
+ @overload # fallback, axis: None
381
+ def partition(
382
+ a: ArrayLike,
383
+ kth: _ArrayLikeInt,
384
+ axis: None,
385
+ kind: _PartitionKind = "introselect",
386
+ order: str | Sequence[str] | None = None,
387
+ ) -> _Array1D[Any]: ...
388
+
389
+ # keep roughly in sync with `ndarray.argpartition`
390
+ @overload # axis: None
391
+ def argpartition(
392
+ a: ArrayLike,
393
+ kth: _ArrayLikeInt,
394
+ axis: None,
395
+ kind: _PartitionKind = "introselect",
396
+ order: None = None,
397
+ ) -> np.ndarray[tuple[int], np.dtype[np.intp]]: ...
398
+ @overload # known shape, axis: index (default)
399
+ def argpartition[ShapeT: _Shape](
400
+ a: np.ndarray[ShapeT],
401
+ kth: _ArrayLikeInt,
402
+ axis: SupportsIndex = -1,
403
+ kind: _PartitionKind = "introselect",
404
+ order: None = None,
405
+ ) -> np.ndarray[ShapeT, np.dtype[np.intp]]: ...
406
+ @overload # 1d array-like, axis: index (default)
407
+ def argpartition(
408
+ a: Sequence[np.generic | complex],
409
+ kth: _ArrayLikeInt,
410
+ axis: SupportsIndex = -1,
411
+ kind: _PartitionKind = "introselect",
412
+ order: None = None,
413
+ ) -> np.ndarray[tuple[int], np.dtype[np.intp]]: ...
414
+ @overload # 2d array-like, axis: index (default)
415
+ def argpartition(
416
+ a: Sequence[Sequence[np.generic | complex]],
417
+ kth: _ArrayLikeInt,
418
+ axis: SupportsIndex = -1,
419
+ kind: _PartitionKind = "introselect",
420
+ order: None = None,
421
+ ) -> np.ndarray[tuple[int, int], np.dtype[np.intp]]: ...
422
+ @overload # ?d array-like, axis: index (default)
423
+ def argpartition(
424
+ a: ArrayLike,
425
+ kth: _ArrayLikeInt,
426
+ axis: SupportsIndex = -1,
427
+ kind: _PartitionKind = "introselect",
428
+ order: None = None,
429
+ ) -> NDArray[np.intp]: ...
430
+ @overload # void, axis: None
431
+ def argpartition(
432
+ a: _SupportsArray[np.dtype[np.void]],
433
+ kth: _ArrayLikeInt,
434
+ axis: None,
435
+ kind: _PartitionKind = "introselect",
436
+ order: str | Sequence[str] | None = None,
437
+ ) -> np.ndarray[tuple[int], np.dtype[intp]]: ...
438
+ @overload # void, axis: index (default)
439
+ def argpartition[ShapeT: _Shape](
440
+ a: np.ndarray[ShapeT, np.dtype[np.void]],
441
+ kth: _ArrayLikeInt,
442
+ axis: SupportsIndex = -1,
443
+ kind: _PartitionKind = "introselect",
444
+ order: str | Sequence[str] | None = None,
445
+ ) -> np.ndarray[ShapeT, np.dtype[np.intp]]: ...
446
+
447
+ #
448
+ @overload
449
+ def sort[ArrayT: np.ndarray](
450
+ a: ArrayT,
451
+ axis: SupportsIndex = -1,
452
+ kind: _SortKind | None = None,
453
+ order: str | Sequence[str] | None = None,
454
+ *,
455
+ stable: bool | None = None,
456
+ descending: bool | _NoValueType = ...,
457
+ ) -> ArrayT: ...
458
+ @overload
459
+ def sort[ScalarT: np.generic](
460
+ a: _ArrayLike[ScalarT],
461
+ axis: SupportsIndex = -1,
462
+ kind: _SortKind | None = None,
463
+ order: str | Sequence[str] | None = None,
464
+ *,
465
+ stable: bool | None = None,
466
+ descending: bool | _NoValueType = ...,
467
+ ) -> NDArray[ScalarT]: ...
468
+ @overload
469
+ def sort[ScalarT: np.generic](
470
+ a: _ArrayLike[ScalarT],
471
+ axis: None,
472
+ kind: _SortKind | None = None,
473
+ order: str | Sequence[str] | None = None,
474
+ *,
475
+ stable: bool | None = None,
476
+ descending: bool | _NoValueType = ...,
477
+ ) -> _Array1D[ScalarT]: ...
478
+ @overload
479
+ def sort(
480
+ a: ArrayLike,
481
+ axis: SupportsIndex = -1,
482
+ kind: _SortKind | None = None,
483
+ order: str | Sequence[str] | None = None,
484
+ *,
485
+ stable: bool | None = None,
486
+ descending: bool | _NoValueType = ...,
487
+ ) -> NDArray[Any]: ...
488
+ @overload
489
+ def sort(
490
+ a: ArrayLike,
491
+ axis: None,
492
+ kind: _SortKind | None = None,
493
+ order: str | Sequence[str] | None = None,
494
+ *,
495
+ stable: bool | None = None,
496
+ descending: bool | _NoValueType = ...,
497
+ ) -> _Array1D[Any]: ...
498
+
499
+ #
500
+ @overload
501
+ def argsort[ShapeT: _Shape](
502
+ a: np.ndarray[ShapeT],
503
+ axis: SupportsIndex = -1,
504
+ kind: _SortKind | None = None,
505
+ order: str | Sequence[str] | None = None,
506
+ *,
507
+ stable: bool | None = None,
508
+ descending: bool | _NoValueType = ...,
509
+ ) -> np.ndarray[ShapeT, np.dtype[np.intp]]: ...
510
+ @overload
511
+ def argsort(
512
+ a: ArrayLike,
513
+ axis: SupportsIndex = -1,
514
+ kind: _SortKind | None = None,
515
+ order: str | Sequence[str] | None = None,
516
+ *,
517
+ stable: bool | None = None,
518
+ descending: bool | _NoValueType = ...,
519
+ ) -> NDArray[np.intp]: ...
520
+ @overload
521
+ def argsort(
522
+ a: ArrayLike,
523
+ axis: None,
524
+ kind: _SortKind | None = None,
525
+ order: str | Sequence[str] | None = None,
526
+ *,
527
+ stable: bool | None = None,
528
+ descending: bool | _NoValueType = ...,
529
+ ) -> _Array1D[np.intp]: ...
530
+
531
+ # keep in sync with `argmin` below
532
+ @overload # ?d
533
+ def argmax(
534
+ a: ArrayLike | _NestedSequence[_Orderable],
535
+ axis: None = None,
536
+ out: None = None,
537
+ *,
538
+ keepdims: Literal[False] | _NoValueType = ...,
539
+ ) -> np.intp: ...
540
+ @overload # ?d, axis: <given>
541
+ def argmax(
542
+ a: ArrayLike | _NestedSequence[_Orderable],
543
+ axis: SupportsIndex,
544
+ out: None = None,
545
+ *,
546
+ keepdims: Literal[False] | _NoValueType = ...,
547
+ ) -> NDArray[np.intp]: ...
548
+ @overload # Nd, keepdims=True
549
+ def argmax[ShapeT: _Shape](
550
+ a: np.ndarray[ShapeT],
551
+ axis: SupportsIndex | None = None,
552
+ out: None = None,
553
+ *,
554
+ keepdims: Literal[True],
555
+ ) -> np.ndarray[ShapeT, np.dtype[np.intp]]: ...
556
+ @overload # ?d, keepdims=True
557
+ def argmax(
558
+ a: ArrayLike | _NestedSequence[_Orderable],
559
+ axis: SupportsIndex | None = None,
560
+ out: None = None,
561
+ *,
562
+ keepdims: Literal[True],
563
+ ) -> NDArray[np.intp]: ...
564
+ @overload # ?d, out: ArrayT
565
+ def argmax[ArrayT: NDArray[np.intp]](
566
+ a: ArrayLike | _NestedSequence[_Orderable],
567
+ axis: SupportsIndex | None = None,
568
+ *,
569
+ out: ArrayT,
570
+ keepdims: bool | _NoValueType = ...,
571
+ ) -> ArrayT: ...
572
+
573
+ # keep in sync with `argmax` above
574
+ @overload # ?d
575
+ def argmin(
576
+ a: ArrayLike | _NestedSequence[_Orderable],
577
+ axis: None = None,
578
+ out: None = None,
579
+ *,
580
+ keepdims: Literal[False] | _NoValueType = ...,
581
+ ) -> np.intp: ...
582
+ @overload # ?d, axis: <given>
583
+ def argmin(
584
+ a: ArrayLike | _NestedSequence[_Orderable],
585
+ axis: SupportsIndex,
586
+ out: None = None,
587
+ *,
588
+ keepdims: Literal[False] | _NoValueType = ...,
589
+ ) -> NDArray[np.intp]: ...
590
+ @overload # Nd, keepdims=True
591
+ def argmin[ShapeT: _Shape](
592
+ a: np.ndarray[ShapeT],
593
+ axis: SupportsIndex | None = None,
594
+ out: None = None,
595
+ *,
596
+ keepdims: Literal[True],
597
+ ) -> np.ndarray[ShapeT, np.dtype[np.intp]]: ...
598
+ @overload # ?d, keepdims=True
599
+ def argmin(
600
+ a: ArrayLike | _NestedSequence[_Orderable],
601
+ axis: SupportsIndex | None = None,
602
+ out: None = None,
603
+ *,
604
+ keepdims: Literal[True],
605
+ ) -> NDArray[np.intp]: ...
606
+ @overload # ?d, out: ArrayT
607
+ def argmin[ArrayT: NDArray[np.intp]](
608
+ a: ArrayLike | _NestedSequence[_Orderable],
609
+ axis: SupportsIndex | None = None,
610
+ *,
611
+ out: ArrayT,
612
+ keepdims: bool | _NoValueType = ...,
613
+ ) -> ArrayT: ...
614
+
615
+ # TODO: Fix overlapping overloads: https://github.com/numpy/numpy/issues/27032
616
+ @overload
617
+ def searchsorted(
618
+ a: ArrayLike,
619
+ v: _ScalarLike_co,
620
+ side: _SortSide = "left",
621
+ sorter: _ArrayLikeInt_co | None = None, # 1D int array
622
+ ) -> intp: ...
623
+ @overload
624
+ def searchsorted(
625
+ a: ArrayLike,
626
+ v: ArrayLike,
627
+ side: _SortSide = "left",
628
+ sorter: _ArrayLikeInt_co | None = None, # 1D int array
629
+ ) -> NDArray[intp]: ...
630
+
631
+ # keep in sync with `ma.core.resize`
632
+ @overload
633
+ def resize[ScalarT: np.generic](a: _ArrayLike[ScalarT], new_shape: SupportsIndex | tuple[SupportsIndex]) -> _Array1D[ScalarT]: ...
634
+ @overload
635
+ def resize[ScalarT: np.generic, AnyShapeT: (_0D, _1D, _2D, _3D, _4D)](
636
+ a: _ArrayLike[ScalarT],
637
+ new_shape: AnyShapeT,
638
+ ) -> np.ndarray[AnyShapeT, np.dtype[ScalarT]]: ...
639
+ @overload
640
+ def resize[ScalarT: np.generic](a: _ArrayLike[ScalarT], new_shape: _ShapeLike) -> NDArray[ScalarT]: ...
641
+ @overload
642
+ def resize(a: ArrayLike, new_shape: SupportsIndex | tuple[SupportsIndex]) -> np.ndarray[_1D]: ...
643
+ @overload
644
+ def resize[AnyShapeT: (_0D, _1D, _2D, _3D, _4D)](a: ArrayLike, new_shape: AnyShapeT) -> np.ndarray[AnyShapeT]: ...
645
+ @overload
646
+ def resize(a: ArrayLike, new_shape: _ShapeLike) -> NDArray[Any]: ...
647
+
648
+ # TODO: Fix overlapping overloads: https://github.com/numpy/numpy/issues/27032
649
+ @overload
650
+ def squeeze[ScalarT: np.generic](a: ScalarT, axis: _ShapeLike | None = None) -> ScalarT: ...
651
+ @overload
652
+ def squeeze[ScalarT: np.generic](a: _ArrayLike[ScalarT], axis: _ShapeLike | None = None) -> NDArray[ScalarT]: ...
653
+ @overload
654
+ def squeeze(a: ArrayLike, axis: _ShapeLike | None = None) -> NDArray[Any]: ...
655
+
656
+ # keep in sync with `ma.core.diagonal`
657
+ @overload # ?d (workaround)
658
+ def diagonal[ScalarT: np.generic](
659
+ a: _ArrayJustND[ScalarT],
660
+ offset: SupportsIndex = 0,
661
+ axis1: SupportsIndex = 0,
662
+ axis2: SupportsIndex = 1,
663
+ ) -> NDArray[ScalarT]: ...
664
+ @overload # 2d
665
+ def diagonal[ScalarT: np.generic](
666
+ a: _ToArray2D[ScalarT],
667
+ offset: SupportsIndex = 0,
668
+ axis1: SupportsIndex = 0,
669
+ axis2: SupportsIndex = 1,
670
+ ) -> _Array1D[ScalarT]: ...
671
+ @overload # 3d
672
+ def diagonal[ScalarT: np.generic](
673
+ a: _ToArray3D[ScalarT],
674
+ offset: SupportsIndex = 0,
675
+ axis1: SupportsIndex = 0,
676
+ axis2: SupportsIndex = 1,
677
+ ) -> _Array2D[ScalarT]: ...
678
+ @overload # Nd
679
+ def diagonal[ScalarT: np.generic](
680
+ a: _ArrayLike[ScalarT],
681
+ offset: SupportsIndex = 0,
682
+ axis1: SupportsIndex = 0,
683
+ axis2: SupportsIndex = 1,
684
+ ) -> NDArray[ScalarT]: ...
685
+ @overload # fallback
686
+ def diagonal(
687
+ a: ArrayLike,
688
+ offset: SupportsIndex = 0,
689
+ axis1: SupportsIndex = 0,
690
+ axis2: SupportsIndex = 1,
691
+ ) -> NDArray[Any]: ...
692
+
693
+ # keep in sync with `ma.core.trace`
694
+ @overload
695
+ def trace(
696
+ a: ArrayLike, # >= 2D array
697
+ offset: SupportsIndex = 0,
698
+ axis1: SupportsIndex = 0,
699
+ axis2: SupportsIndex = 1,
700
+ dtype: DTypeLike | None = None,
701
+ out: None = None,
702
+ ) -> Any: ...
703
+ @overload
704
+ def trace[ArrayT: np.ndarray](
705
+ a: ArrayLike, # >= 2D array
706
+ offset: SupportsIndex,
707
+ axis1: SupportsIndex,
708
+ axis2: SupportsIndex,
709
+ dtype: DTypeLike | None,
710
+ out: ArrayT,
711
+ ) -> ArrayT: ...
712
+ @overload
713
+ def trace[ArrayT: np.ndarray](
714
+ a: ArrayLike, # >= 2D array
715
+ offset: SupportsIndex = 0,
716
+ axis1: SupportsIndex = 0,
717
+ axis2: SupportsIndex = 1,
718
+ dtype: DTypeLike | None = None,
719
+ *,
720
+ out: ArrayT,
721
+ ) -> ArrayT: ...
722
+
723
+ @overload
724
+ def ravel[ScalarT: np.generic](a: _ArrayLike[ScalarT], order: _OrderKACF = "C") -> _Array1D[ScalarT]: ...
725
+ @overload
726
+ def ravel(a: bytes | _NestedSequence[bytes], order: _OrderKACF = "C") -> _Array1D[np.bytes_]: ...
727
+ @overload
728
+ def ravel(a: str | _NestedSequence[str], order: _OrderKACF = "C") -> _Array1D[np.str_]: ...
729
+ @overload
730
+ def ravel(a: bool | _NestedSequence[bool], order: _OrderKACF = "C") -> _Array1D[np.bool]: ...
731
+ @overload
732
+ def ravel(a: int | _NestedSequence[int], order: _OrderKACF = "C") -> _Array1D[np.int_ | Any]: ...
733
+ @overload
734
+ def ravel(a: float | _NestedSequence[float], order: _OrderKACF = "C") -> _Array1D[np.float64 | Any]: ...
735
+ @overload
736
+ def ravel(a: complex | _NestedSequence[complex], order: _OrderKACF = "C") -> _Array1D[np.complex128 | Any]: ...
737
+ @overload
738
+ def ravel(a: ArrayLike, order: _OrderKACF = "C") -> np.ndarray[_1D]: ...
739
+
740
+ # keep in sync with the 1-arg overloads of `_core.multiarray.where`
741
+ @overload # ?d (workaround)
742
+ def nonzero(a: _ArrayJustND[Any]) -> tuple[_Array1D[np.intp], ...]: ...
743
+ @overload # 1d
744
+ def nonzero(a: _ToArray1D[Any]) -> tuple[_Array1D[np.intp]]: ...
745
+ @overload # 2d
746
+ def nonzero(a: _ToArray2D[Any]) -> tuple[_Array1D[np.intp], _Array1D[np.intp]]: ...
747
+ @overload # 3d
748
+ def nonzero(a: _ToArray3D[Any]) -> tuple[_Array1D[np.intp], _Array1D[np.intp], _Array1D[np.intp]]: ...
749
+ @overload # Nd (fallback)
750
+ def nonzero(a: _ArrayLike[Any]) -> tuple[_Array1D[np.intp], ...]: ...
751
+
752
+ # `collections.abc.Sequence` can't be used here because `bytes` and `str` are
753
+ # subtypes of it, which would make the return types incompatible.
754
+ @overload # this prevents `Any` from being returned with Pyright
755
+ def shape(a: _SupportsShape[Never]) -> _AnyShape: ...
756
+ @overload
757
+ def shape[ShapeT: _Shape](a: _SupportsShape[ShapeT]) -> ShapeT: ...
758
+ @overload
759
+ def shape(a: _PyScalar) -> tuple[()]: ...
760
+ @overload # an unbound type variable is used because `list` is invariant
761
+ def shape[ScalarT: _PyScalar](a: _PyArray[ScalarT]) -> _1D: ...
762
+ @overload
763
+ def shape[ScalarT: _PyScalar](a: Sequence[_PyArray[ScalarT]]) -> _2D: ...
764
+ @overload
765
+ def shape[ScalarT: _PyScalar](a: Sequence[Sequence[_PyArray[ScalarT]]]) -> _3D: ...
766
+ @overload # this will be skipped by typecheckers that don't support PEP 688
767
+ def shape(a: memoryview | bytearray) -> _1D: ...
768
+ @overload
769
+ def shape(a: ArrayLike) -> _AnyShape: ...
770
+
771
+ #
772
+ @overload
773
+ def compress[ScalarT: np.generic](
774
+ condition: _ArrayLikeBool_co, # 1D bool array
775
+ a: _ArrayLike[ScalarT],
776
+ axis: SupportsIndex | None = None,
777
+ out: None = None,
778
+ ) -> NDArray[ScalarT]: ...
779
+ @overload
780
+ def compress(
781
+ condition: _ArrayLikeBool_co, # 1D bool array
782
+ a: ArrayLike,
783
+ axis: SupportsIndex | None = None,
784
+ out: None = None,
785
+ ) -> NDArray[Any]: ...
786
+ @overload
787
+ def compress[ArrayT: np.ndarray](
788
+ condition: _ArrayLikeBool_co, # 1D bool array
789
+ a: ArrayLike,
790
+ axis: SupportsIndex | None,
791
+ out: ArrayT,
792
+ ) -> ArrayT: ...
793
+ @overload
794
+ def compress[ArrayT: np.ndarray](
795
+ condition: _ArrayLikeBool_co, # 1D bool array
796
+ a: ArrayLike,
797
+ axis: SupportsIndex | None = None,
798
+ *,
799
+ out: ArrayT,
800
+ ) -> ArrayT: ...
801
+
802
+ # TODO: Fix overlapping overloads: https://github.com/numpy/numpy/issues/27032
803
+ @overload
804
+ def clip[ScalarOrArrayT: np.generic | np.ndarray](
805
+ a: ScalarOrArrayT,
806
+ a_min: ArrayLike | _NoValueType | None = ...,
807
+ a_max: ArrayLike | _NoValueType | None = ...,
808
+ out: None = None,
809
+ *,
810
+ min: ArrayLike | _NoValueType | None = ...,
811
+ max: ArrayLike | _NoValueType | None = ...,
812
+ dtype: None = None,
813
+ **kwargs: Unpack[_UFuncKwargs],
814
+ ) -> ScalarOrArrayT: ...
815
+ @overload
816
+ def clip(
817
+ a: _ScalarLike_co,
818
+ a_min: ArrayLike | _NoValueType | None = ...,
819
+ a_max: ArrayLike | _NoValueType | None = ...,
820
+ out: None = None,
821
+ *,
822
+ min: ArrayLike | _NoValueType | None = ...,
823
+ max: ArrayLike | _NoValueType | None = ...,
824
+ dtype: None = None,
825
+ **kwargs: Unpack[_UFuncKwargs],
826
+ ) -> Any: ...
827
+ @overload
828
+ def clip[ScalarT: np.generic](
829
+ a: _ArrayLike[ScalarT],
830
+ a_min: ArrayLike | _NoValueType | None = ...,
831
+ a_max: ArrayLike | _NoValueType | None = ...,
832
+ out: None = None,
833
+ *,
834
+ min: ArrayLike | _NoValueType | None = ...,
835
+ max: ArrayLike | _NoValueType | None = ...,
836
+ dtype: None = None,
837
+ **kwargs: Unpack[_UFuncKwargs],
838
+ ) -> NDArray[ScalarT]: ...
839
+ @overload
840
+ def clip(
841
+ a: ArrayLike,
842
+ a_min: ArrayLike | _NoValueType | None = ...,
843
+ a_max: ArrayLike | _NoValueType | None = ...,
844
+ out: None = None,
845
+ *,
846
+ min: ArrayLike | _NoValueType | None = ...,
847
+ max: ArrayLike | _NoValueType | None = ...,
848
+ dtype: None = None,
849
+ **kwargs: Unpack[_UFuncKwargs],
850
+ ) -> NDArray[Any]: ...
851
+ @overload
852
+ def clip[ArrayT: np.ndarray](
853
+ a: ArrayLike,
854
+ a_min: ArrayLike | None,
855
+ a_max: ArrayLike | None,
856
+ out: ArrayT,
857
+ *,
858
+ min: ArrayLike | _NoValueType | None = ...,
859
+ max: ArrayLike | _NoValueType | None = ...,
860
+ dtype: DTypeLike | None = None,
861
+ **kwargs: Unpack[_UFuncKwargs],
862
+ ) -> ArrayT: ...
863
+ @overload
864
+ def clip[ArrayT: np.ndarray](
865
+ a: ArrayLike,
866
+ a_min: ArrayLike | _NoValueType | None = ...,
867
+ a_max: ArrayLike | _NoValueType | None = ...,
868
+ *,
869
+ out: ArrayT,
870
+ min: ArrayLike | _NoValueType | None = ...,
871
+ max: ArrayLike | _NoValueType | None = ...,
872
+ dtype: DTypeLike | None = None,
873
+ **kwargs: Unpack[_UFuncKwargs],
874
+ ) -> ArrayT: ...
875
+ @overload
876
+ def clip(
877
+ a: ArrayLike,
878
+ a_min: ArrayLike | _NoValueType | None = ...,
879
+ a_max: ArrayLike | _NoValueType | None = ...,
880
+ out: None = None,
881
+ *,
882
+ min: ArrayLike | _NoValueType | None = ...,
883
+ max: ArrayLike | _NoValueType | None = ...,
884
+ dtype: DTypeLike | None = None,
885
+ **kwargs: Unpack[_UFuncKwargs],
886
+ ) -> Any: ...
887
+
888
+ # keep in sync with `any`
889
+ @overload
890
+ def all(
891
+ a: ArrayLike | None,
892
+ axis: None = None,
893
+ out: None = None,
894
+ keepdims: Literal[False] | _NoValueType = ...,
895
+ *,
896
+ where: _ArrayLikeBool_co | _NoValueType = ...,
897
+ ) -> np.bool: ...
898
+ @overload # axis: int
899
+ def all[ShapeT: _Shape](
900
+ a: ArrayLike,
901
+ axis: int,
902
+ out: None = None,
903
+ keepdims: Literal[False] | _NoValueType = ...,
904
+ *,
905
+ where: _ArrayLikeBool_co | _NoValueType = ...,
906
+ ) -> NDArray[np.bool]: ...
907
+ @overload # axis: (int, ...)
908
+ def all[ShapeT: _Shape](
909
+ a: ArrayLike,
910
+ axis: tuple[int, ...],
911
+ out: None = None,
912
+ keepdims: Literal[False] | _NoValueType = ...,
913
+ *,
914
+ where: _ArrayLikeBool_co | _NoValueType = ...,
915
+ ) -> NDArray[np.bool] | Any: ...
916
+ @overload # Nd, keepdims: True
917
+ def all[ShapeT: _Shape](
918
+ a: np.ndarray[ShapeT],
919
+ axis: int | tuple[int, ...] | None = None,
920
+ out: None = None,
921
+ *,
922
+ keepdims: Literal[True],
923
+ where: _ArrayLikeBool_co | _NoValueType = ...,
924
+ ) -> np.ndarray[ShapeT, np.dtype[np.bool]]: ...
925
+ @overload # ?d, keepdims: True
926
+ def all[ShapeT: _Shape](
927
+ a: ArrayLike,
928
+ axis: int | tuple[int, ...] | None = None,
929
+ out: None = None,
930
+ *,
931
+ keepdims: Literal[True],
932
+ where: _ArrayLikeBool_co | _NoValueType = ...,
933
+ ) -> NDArray[np.bool]: ...
934
+ @overload # out: <given> (keyword)
935
+ def all[ArrayT: np.ndarray](
936
+ a: ArrayLike | None,
937
+ axis: int | tuple[int, ...] | None = None,
938
+ *,
939
+ out: ArrayT,
940
+ keepdims: bool | _NoValueType = ...,
941
+ where: _ArrayLikeBool_co | _NoValueType = ...,
942
+ ) -> ArrayT: ...
943
+ @overload # out: <given> (positional)
944
+ def all[ArrayT: np.ndarray](
945
+ a: ArrayLike | None,
946
+ axis: int | tuple[int, ...] | None,
947
+ out: ArrayT,
948
+ keepdims: bool | _NoValueType = ...,
949
+ *,
950
+ where: _ArrayLikeBool_co | _NoValueType = ...,
951
+ ) -> ArrayT: ...
952
+
953
+ # keep in sync with `all`
954
+ @overload
955
+ def any(
956
+ a: ArrayLike | None,
957
+ axis: None = None,
958
+ out: None = None,
959
+ keepdims: Literal[False] | _NoValueType = ...,
960
+ *,
961
+ where: _ArrayLikeBool_co | _NoValueType = ...,
962
+ ) -> np.bool: ...
963
+ @overload # axis: int
964
+ def any[ShapeT: _Shape](
965
+ a: ArrayLike,
966
+ axis: int,
967
+ out: None = None,
968
+ keepdims: Literal[False] | _NoValueType = ...,
969
+ *,
970
+ where: _ArrayLikeBool_co | _NoValueType = ...,
971
+ ) -> NDArray[np.bool]: ...
972
+ @overload # axis: (int, ...)
973
+ def any[ShapeT: _Shape](
974
+ a: ArrayLike,
975
+ axis: tuple[int, ...],
976
+ out: None = None,
977
+ keepdims: Literal[False] | _NoValueType = ...,
978
+ *,
979
+ where: _ArrayLikeBool_co | _NoValueType = ...,
980
+ ) -> NDArray[np.bool] | Any: ...
981
+ @overload # Nd, keepdims: True
982
+ def any[ShapeT: _Shape](
983
+ a: np.ndarray[ShapeT],
984
+ axis: int | tuple[int, ...] | None = None,
985
+ out: None = None,
986
+ *,
987
+ keepdims: Literal[True],
988
+ where: _ArrayLikeBool_co | _NoValueType = ...,
989
+ ) -> np.ndarray[ShapeT, np.dtype[np.bool]]: ...
990
+ @overload # ?d, keepdims: True
991
+ def any[ShapeT: _Shape](
992
+ a: ArrayLike,
993
+ axis: int | tuple[int, ...] | None = None,
994
+ out: None = None,
995
+ *,
996
+ keepdims: Literal[True],
997
+ where: _ArrayLikeBool_co | _NoValueType = ...,
998
+ ) -> NDArray[np.bool]: ...
999
+ @overload # out: <given> (keyword)
1000
+ def any[ArrayT: np.ndarray](
1001
+ a: ArrayLike | None,
1002
+ axis: int | tuple[int, ...] | None = None,
1003
+ *,
1004
+ out: ArrayT,
1005
+ keepdims: bool | _NoValueType = ...,
1006
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1007
+ ) -> ArrayT: ...
1008
+ @overload # out: <given> (positional)
1009
+ def any[ArrayT: np.ndarray](
1010
+ a: ArrayLike | None,
1011
+ axis: int | tuple[int, ...] | None,
1012
+ out: ArrayT,
1013
+ keepdims: bool | _NoValueType = ...,
1014
+ *,
1015
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1016
+ ) -> ArrayT: ...
1017
+
1018
+ # keep in sync with `cumprod` below
1019
+ @overload
1020
+ def cumsum[ScalarT: np.inexact | np.timedelta64 | np.object_](
1021
+ a: _ArrayLike[ScalarT],
1022
+ axis: None = None,
1023
+ dtype: None = None,
1024
+ out: None = None,
1025
+ ) -> _Array1D[ScalarT]: ...
1026
+ @overload
1027
+ def cumsum[ArrayT: np.ndarray[Any, np.dtype[np.inexact | np.timedelta64 | np.object_] | np.dtypes.StringDType]](
1028
+ a: ArrayT,
1029
+ axis: SupportsIndex,
1030
+ dtype: None = None,
1031
+ out: None = None,
1032
+ ) -> ArrayT: ...
1033
+ @overload
1034
+ def cumsum[ScalarT: np.inexact | np.timedelta64 | np.object_](
1035
+ a: _ArrayLike[ScalarT],
1036
+ axis: SupportsIndex,
1037
+ dtype: None = None,
1038
+ out: None = None,
1039
+ ) -> NDArray[ScalarT]: ...
1040
+ @overload
1041
+ def cumsum(
1042
+ a: _ArrayLikeInt_co,
1043
+ axis: None = None,
1044
+ dtype: None = None,
1045
+ out: None = None,
1046
+ ) -> _Array1D[np.int_]: ...
1047
+ @overload
1048
+ def cumsum[ShapeT: _Shape](
1049
+ a: np.ndarray[ShapeT, np.dtype[np.bool | np.integer]],
1050
+ axis: SupportsIndex,
1051
+ dtype: None = None,
1052
+ out: None = None,
1053
+ ) -> np.ndarray[ShapeT, np.dtype[np.int_]]: ...
1054
+ @overload
1055
+ def cumsum(
1056
+ a: _ArrayLikeInt_co,
1057
+ axis: SupportsIndex,
1058
+ dtype: None = None,
1059
+ out: None = None,
1060
+ ) -> NDArray[np.int_]: ...
1061
+ @overload
1062
+ def cumsum(
1063
+ a: ArrayLike,
1064
+ axis: None = None,
1065
+ dtype: None = None,
1066
+ out: None = None,
1067
+ ) -> _Array1D[Any]: ...
1068
+ @overload
1069
+ def cumsum(
1070
+ a: ArrayLike,
1071
+ axis: SupportsIndex,
1072
+ dtype: None = None,
1073
+ out: None = None,
1074
+ ) -> NDArray[Any]: ...
1075
+ @overload
1076
+ def cumsum[ScalarT: np.generic](
1077
+ a: ArrayLike,
1078
+ axis: None,
1079
+ dtype: _DTypeLike[ScalarT],
1080
+ out: None = None,
1081
+ ) -> _Array1D[ScalarT]: ...
1082
+ @overload
1083
+ def cumsum[ScalarT: np.generic](
1084
+ a: ArrayLike,
1085
+ axis: None = None,
1086
+ *,
1087
+ dtype: _DTypeLike[ScalarT],
1088
+ out: None = None,
1089
+ ) -> _Array1D[ScalarT]: ...
1090
+ @overload
1091
+ def cumsum[ScalarT: np.generic](
1092
+ a: ArrayLike,
1093
+ axis: SupportsIndex,
1094
+ dtype: _DTypeLike[ScalarT],
1095
+ out: None = None,
1096
+ ) -> NDArray[ScalarT]: ...
1097
+ @overload
1098
+ def cumsum(
1099
+ a: ArrayLike,
1100
+ axis: None = None,
1101
+ dtype: DTypeLike | None = None,
1102
+ out: None = None,
1103
+ ) -> _Array1D[Any]: ...
1104
+ @overload
1105
+ def cumsum(
1106
+ a: ArrayLike,
1107
+ axis: SupportsIndex,
1108
+ dtype: DTypeLike | None = None,
1109
+ out: None = None,
1110
+ ) -> NDArray[Any]: ...
1111
+ @overload
1112
+ def cumsum[ArrayT: np.ndarray](
1113
+ a: ArrayLike,
1114
+ axis: SupportsIndex | None,
1115
+ dtype: DTypeLike | None,
1116
+ out: ArrayT,
1117
+ ) -> ArrayT: ...
1118
+ @overload
1119
+ def cumsum[ArrayT: np.ndarray](
1120
+ a: ArrayLike,
1121
+ axis: SupportsIndex | None = None,
1122
+ dtype: DTypeLike | None = None,
1123
+ *,
1124
+ out: ArrayT,
1125
+ ) -> ArrayT: ...
1126
+
1127
+ # keep in sync with `cumulative_prod` below
1128
+ @overload
1129
+ def cumulative_sum[ScalarT: np.inexact | np.timedelta64 | np.object_](
1130
+ x: _ArrayLike[ScalarT],
1131
+ /,
1132
+ *,
1133
+ axis: None = None,
1134
+ dtype: None = None,
1135
+ out: None = None,
1136
+ include_initial: bool = False,
1137
+ ) -> _Array1D[ScalarT]: ...
1138
+ @overload
1139
+ def cumulative_sum[ArrayT: np.ndarray[Any, np.dtype[np.inexact | np.timedelta64 | np.object_] | np.dtypes.StringDType]](
1140
+ x: ArrayT,
1141
+ /,
1142
+ *,
1143
+ axis: SupportsIndex,
1144
+ dtype: None = None,
1145
+ out: None = None,
1146
+ include_initial: bool = False,
1147
+ ) -> ArrayT: ...
1148
+ @overload
1149
+ def cumulative_sum[ScalarT: np.inexact | np.timedelta64 | np.object_](
1150
+ x: _ArrayLike[ScalarT],
1151
+ /,
1152
+ *,
1153
+ axis: SupportsIndex,
1154
+ dtype: None = None,
1155
+ out: None = None,
1156
+ include_initial: bool = False,
1157
+ ) -> NDArray[ScalarT]: ...
1158
+ @overload
1159
+ def cumulative_sum(
1160
+ x: _ArrayLikeInt_co,
1161
+ /,
1162
+ *,
1163
+ axis: None = None,
1164
+ dtype: None = None,
1165
+ out: None = None,
1166
+ include_initial: bool = False,
1167
+ ) -> _Array1D[np.int_]: ...
1168
+ @overload
1169
+ def cumulative_sum[ShapeT: _Shape](
1170
+ x: np.ndarray[ShapeT, np.dtype[np.bool | np.integer]],
1171
+ /,
1172
+ *,
1173
+ axis: SupportsIndex,
1174
+ dtype: None = None,
1175
+ out: None = None,
1176
+ include_initial: bool = False,
1177
+ ) -> np.ndarray[ShapeT, np.dtype[np.int_]]: ...
1178
+ @overload
1179
+ def cumulative_sum(
1180
+ x: _ArrayLikeInt_co,
1181
+ /,
1182
+ *,
1183
+ axis: SupportsIndex,
1184
+ dtype: None = None,
1185
+ out: None = None,
1186
+ include_initial: bool = False,
1187
+ ) -> NDArray[np.int_]: ...
1188
+ @overload
1189
+ def cumulative_sum(
1190
+ x: ArrayLike,
1191
+ /,
1192
+ *,
1193
+ axis: None = None,
1194
+ dtype: None = None,
1195
+ out: None = None,
1196
+ include_initial: bool = False,
1197
+ ) -> _Array1D[Any]: ...
1198
+ @overload
1199
+ def cumulative_sum(
1200
+ x: ArrayLike,
1201
+ /,
1202
+ *,
1203
+ axis: SupportsIndex,
1204
+ dtype: None = None,
1205
+ out: None = None,
1206
+ include_initial: bool = False,
1207
+ ) -> NDArray[Any]: ...
1208
+ @overload
1209
+ def cumulative_sum[ScalarT: np.generic](
1210
+ x: ArrayLike,
1211
+ /,
1212
+ *,
1213
+ axis: None = None,
1214
+ dtype: _DTypeLike[ScalarT],
1215
+ out: None = None,
1216
+ include_initial: bool = False,
1217
+ ) -> _Array1D[ScalarT]: ...
1218
+ @overload
1219
+ def cumulative_sum[ScalarT: np.generic](
1220
+ x: ArrayLike,
1221
+ /,
1222
+ *,
1223
+ axis: SupportsIndex,
1224
+ dtype: _DTypeLike[ScalarT],
1225
+ out: None = None,
1226
+ include_initial: bool = False,
1227
+ ) -> NDArray[ScalarT]: ...
1228
+ @overload
1229
+ def cumulative_sum(
1230
+ x: ArrayLike,
1231
+ /,
1232
+ *,
1233
+ axis: None = None,
1234
+ dtype: DTypeLike | None = None,
1235
+ out: None = None,
1236
+ include_initial: bool = False,
1237
+ ) -> _Array1D[Any]: ...
1238
+ @overload
1239
+ def cumulative_sum(
1240
+ x: ArrayLike,
1241
+ /,
1242
+ *,
1243
+ axis: SupportsIndex,
1244
+ dtype: DTypeLike | None = None,
1245
+ out: None = None,
1246
+ include_initial: bool = False,
1247
+ ) -> NDArray[Any]: ...
1248
+ @overload
1249
+ def cumulative_sum[ArrayT: np.ndarray](
1250
+ x: ArrayLike,
1251
+ /,
1252
+ *,
1253
+ axis: SupportsIndex | None = None,
1254
+ dtype: DTypeLike | None = None,
1255
+ out: ArrayT,
1256
+ include_initial: bool = False,
1257
+ ) -> ArrayT: ...
1258
+
1259
+ #
1260
+ @overload # ~builtins.int
1261
+ def ptp(
1262
+ a: _NestedSequence[list[int]] | list[int],
1263
+ axis: None = None,
1264
+ out: None = None,
1265
+ keepdims: Literal[False] | _NoValueType = ...,
1266
+ ) -> np.int_: ...
1267
+ @overload # ~builtins.int, axis: <given>
1268
+ def ptp(
1269
+ a: _NestedSequence[list[int]] | list[int],
1270
+ axis: int | tuple[int, ...],
1271
+ out: None = None,
1272
+ keepdims: Literal[False] | _NoValueType = ...,
1273
+ ) -> NDArray[np.int_]: ...
1274
+ @overload # ~builtins.int, keepdims=True
1275
+ def ptp(
1276
+ a: _NestedSequence[list[int]] | list[int],
1277
+ axis: int | tuple[int, ...] | None = None,
1278
+ out: None = None,
1279
+ *,
1280
+ keepdims: Literal[True],
1281
+ ) -> NDArray[np.int_]: ...
1282
+ @overload # ~builtins.float
1283
+ def ptp(
1284
+ a: _NestedSequence[list[float]] | list[float],
1285
+ axis: None = None,
1286
+ out: None = None,
1287
+ keepdims: Literal[False] | _NoValueType = ...,
1288
+ ) -> np.float64: ...
1289
+ @overload # ~builtins.float, axis: <given>
1290
+ def ptp(
1291
+ a: _NestedSequence[list[float]] | list[float],
1292
+ axis: int | tuple[int, ...],
1293
+ out: None = None,
1294
+ keepdims: Literal[False] | _NoValueType = ...,
1295
+ ) -> NDArray[np.float64]: ...
1296
+ @overload # ~builtins.float, keepdims=True
1297
+ def ptp(
1298
+ a: _NestedSequence[list[float]] | list[float],
1299
+ axis: int | tuple[int, ...] | None = None,
1300
+ out: None = None,
1301
+ *,
1302
+ keepdims: Literal[True],
1303
+ ) -> NDArray[np.float64]: ...
1304
+ @overload # ~builtins.complex
1305
+ def ptp(
1306
+ a: _NestedSequence[list[complex]] | list[complex],
1307
+ axis: None = None,
1308
+ out: None = None,
1309
+ keepdims: Literal[False] | _NoValueType = ...,
1310
+ ) -> np.complex128: ...
1311
+ @overload # ~builtins.complex, axis: <given>
1312
+ def ptp(
1313
+ a: _NestedSequence[list[complex]] | list[complex],
1314
+ axis: int | tuple[int, ...],
1315
+ out: None = None,
1316
+ keepdims: Literal[False] | _NoValueType = ...,
1317
+ ) -> NDArray[np.complex128]: ...
1318
+ @overload # ~builtins.complex, keepdims=True
1319
+ def ptp(
1320
+ a: _NestedSequence[list[complex]] | list[complex],
1321
+ axis: int | tuple[int, ...] | None = None,
1322
+ out: None = None,
1323
+ *,
1324
+ keepdims: Literal[True],
1325
+ ) -> NDArray[np.complex128]: ...
1326
+ @overload # ~number | timedelta64
1327
+ def ptp[ScalarT: np.number | np.timedelta64](
1328
+ a: _ArrayLike[ScalarT],
1329
+ axis: None = None,
1330
+ out: None = None,
1331
+ keepdims: Literal[False] | _NoValueType = ...,
1332
+ ) -> ScalarT: ...
1333
+ @overload # ~number | timedelta64 | object_, axis: <given>
1334
+ def ptp[ScalarT: np.number | np.timedelta64 | np.object_](
1335
+ a: _ArrayLike[ScalarT],
1336
+ axis: int | tuple[int, ...],
1337
+ out: None = None,
1338
+ keepdims: Literal[False] | _NoValueType = ...,
1339
+ ) -> NDArray[ScalarT]: ...
1340
+ @overload # ~number | timedelta64 | datetime64 | object_, keepdims=True
1341
+ def ptp[ArrayT: NDArray[np.number | np.timedelta64 | np.object_]](
1342
+ a: ArrayT,
1343
+ axis: int | tuple[int, ...] | None = None,
1344
+ out: None = None,
1345
+ *,
1346
+ keepdims: Literal[True],
1347
+ ) -> ArrayT: ...
1348
+ @overload # datetime64
1349
+ def ptp(
1350
+ a: _ArrayLike[np.datetime64],
1351
+ axis: None = None,
1352
+ out: None = None,
1353
+ keepdims: Literal[False] | _NoValueType = ...,
1354
+ ) -> np.timedelta64[Any]: ...
1355
+ @overload # datetime64, axis: <given>
1356
+ def ptp(
1357
+ a: _ArrayLike[np.datetime64],
1358
+ axis: int | tuple[int, ...],
1359
+ out: None = None,
1360
+ keepdims: Literal[False] | _NoValueType = ...,
1361
+ ) -> NDArray[np.timedelta64]: ...
1362
+ @overload # datetime64, keepdims=True
1363
+ def ptp[ShapeT: _Shape](
1364
+ a: np.ndarray[ShapeT, np.dtype[np.datetime64]],
1365
+ axis: int | tuple[int, ...] | None = None,
1366
+ out: None = None,
1367
+ *,
1368
+ keepdims: Literal[True],
1369
+ ) -> np.ndarray[ShapeT, np.dtype[np.timedelta64]]: ...
1370
+ @overload # object_
1371
+ def ptp(
1372
+ a: _ArrayLike[np.object_],
1373
+ axis: None = None,
1374
+ out: None = None,
1375
+ keepdims: Literal[False] | _NoValueType = ...,
1376
+ ) -> Any: ...
1377
+ @overload # out: ArrayT
1378
+ def ptp[ArrayT: np.ndarray](
1379
+ a: _ArrayLikeNumeric_co,
1380
+ axis: int | tuple[int, ...] | None = None,
1381
+ *,
1382
+ out: ArrayT,
1383
+ keepdims: bool | _NoValueType = ...,
1384
+ ) -> ArrayT: ...
1385
+ @overload # fallback
1386
+ def ptp(
1387
+ a: _ArrayLikeNumeric_co,
1388
+ axis: None = None,
1389
+ out: None = None,
1390
+ keepdims: Literal[False] | _NoValueType = ...,
1391
+ ) -> Any: ...
1392
+ @overload # fallback, axis: <given>
1393
+ def ptp(
1394
+ a: _ArrayLikeNumeric_co,
1395
+ axis: int | tuple[int, ...],
1396
+ out: None = None,
1397
+ keepdims: Literal[False] | _NoValueType = ...,
1398
+ ) -> NDArray[Any]: ...
1399
+ @overload # fallback, keepdims=True
1400
+ def ptp(
1401
+ a: _ArrayLikeNumeric_co,
1402
+ axis: int | tuple[int, ...] | None = None,
1403
+ out: None = None,
1404
+ *,
1405
+ keepdims: Literal[True],
1406
+ ) -> NDArray[Any]: ...
1407
+
1408
+ # keep in sync with `amin` below
1409
+ @overload # sequence of just `Any` (workaround)
1410
+ def amax(
1411
+ a: _NestedSequence[Never],
1412
+ axis: None = None,
1413
+ out: None = None,
1414
+ keepdims: Literal[False] | _NoValueType = ...,
1415
+ initial: _NumberLike_co | _NoValueType = ...,
1416
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1417
+ ) -> Any: ...
1418
+ @overload # builtins.bool
1419
+ def amax(
1420
+ a: _NestedSequence[bool],
1421
+ axis: None = None,
1422
+ out: None = None,
1423
+ keepdims: Literal[False] | _NoValueType = ...,
1424
+ initial: _NumberLike_co | _NoValueType = ...,
1425
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1426
+ ) -> np.bool: ...
1427
+ @overload # builtins.bool, axis: <given>
1428
+ def amax(
1429
+ a: _NestedSequence[bool],
1430
+ axis: int | tuple[int, ...],
1431
+ out: None = None,
1432
+ keepdims: Literal[False] | _NoValueType = ...,
1433
+ initial: _NumberLike_co | _NoValueType = ...,
1434
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1435
+ ) -> NDArray[np.bool]: ...
1436
+ @overload # builtins.bool, keepdims=True
1437
+ def amax(
1438
+ a: _NestedSequence[bool],
1439
+ axis: int | tuple[int, ...] | None = None,
1440
+ out: None = None,
1441
+ *,
1442
+ keepdims: Literal[True],
1443
+ initial: _NumberLike_co | _NoValueType = ...,
1444
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1445
+ ) -> NDArray[np.bool]: ...
1446
+ @overload # ~builtins.int
1447
+ def amax(
1448
+ a: _NestedSequence[list[int]] | list[int],
1449
+ axis: None = None,
1450
+ out: None = None,
1451
+ keepdims: Literal[False] | _NoValueType = ...,
1452
+ initial: _NumberLike_co | _NoValueType = ...,
1453
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1454
+ ) -> np.int_: ...
1455
+ @overload # ~builtins.int, axis: <given>
1456
+ def amax(
1457
+ a: _NestedSequence[list[int]] | list[int],
1458
+ axis: int | tuple[int, ...],
1459
+ out: None = None,
1460
+ keepdims: Literal[False] | _NoValueType = ...,
1461
+ initial: _NumberLike_co | _NoValueType = ...,
1462
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1463
+ ) -> NDArray[np.int_]: ...
1464
+ @overload # ~builtins.int, keepdims=True
1465
+ def amax(
1466
+ a: _NestedSequence[list[int]] | list[int],
1467
+ axis: int | tuple[int, ...] | None = None,
1468
+ out: None = None,
1469
+ *,
1470
+ keepdims: Literal[True],
1471
+ initial: _NumberLike_co | _NoValueType = ...,
1472
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1473
+ ) -> NDArray[np.int_]: ...
1474
+ @overload # ~builtins.float
1475
+ def amax(
1476
+ a: _NestedSequence[list[float]] | list[float],
1477
+ axis: None = None,
1478
+ out: None = None,
1479
+ keepdims: Literal[False] | _NoValueType = ...,
1480
+ initial: _NumberLike_co | _NoValueType = ...,
1481
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1482
+ ) -> np.float64: ...
1483
+ @overload # ~builtins.float, axis: <given>
1484
+ def amax(
1485
+ a: _NestedSequence[list[float]] | list[float],
1486
+ axis: int | tuple[int, ...],
1487
+ out: None = None,
1488
+ keepdims: Literal[False] | _NoValueType = ...,
1489
+ initial: _NumberLike_co | _NoValueType = ...,
1490
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1491
+ ) -> NDArray[np.float64]: ...
1492
+ @overload # ~builtins.float, keepdims=True
1493
+ def amax(
1494
+ a: _NestedSequence[list[float]] | list[float],
1495
+ axis: int | tuple[int, ...] | None = None,
1496
+ out: None = None,
1497
+ *,
1498
+ keepdims: Literal[True],
1499
+ initial: _NumberLike_co | _NoValueType = ...,
1500
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1501
+ ) -> NDArray[np.float64]: ...
1502
+ @overload # ~builtins.complex
1503
+ def amax(
1504
+ a: _NestedSequence[list[complex]] | list[complex],
1505
+ axis: None = None,
1506
+ out: None = None,
1507
+ keepdims: Literal[False] | _NoValueType = ...,
1508
+ initial: _NumberLike_co | _NoValueType = ...,
1509
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1510
+ ) -> np.complex128: ...
1511
+ @overload # ~builtins.complex, axis: <given>
1512
+ def amax(
1513
+ a: _NestedSequence[list[complex]] | list[complex],
1514
+ axis: int | tuple[int, ...],
1515
+ out: None = None,
1516
+ keepdims: Literal[False] | _NoValueType = ...,
1517
+ initial: _NumberLike_co | _NoValueType = ...,
1518
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1519
+ ) -> NDArray[np.complex128]: ...
1520
+ @overload # ~builtins.complex, keepdims=True
1521
+ def amax(
1522
+ a: _NestedSequence[list[complex]] | list[complex],
1523
+ axis: int | tuple[int, ...] | None = None,
1524
+ out: None = None,
1525
+ *,
1526
+ keepdims: Literal[True],
1527
+ initial: _NumberLike_co | _NoValueType = ...,
1528
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1529
+ ) -> NDArray[np.complex128]: ...
1530
+ @overload # +number | timedelta64 | datetime64
1531
+ def amax[ScalarT: np.number | np.bool | np.timedelta64 | np.datetime64](
1532
+ a: _ArrayLike[ScalarT],
1533
+ axis: None = None,
1534
+ out: None = None,
1535
+ keepdims: Literal[False] | _NoValueType = ...,
1536
+ initial: _NumberLike_co | _NoValueType = ...,
1537
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1538
+ ) -> ScalarT: ...
1539
+ @overload # +number | timedelta64 | datetime64 | object_, axis: <given>
1540
+ def amax[ScalarT: np.number | np.bool | np.timedelta64 | np.datetime64 | np.object_](
1541
+ a: _ArrayLike[ScalarT],
1542
+ axis: int | tuple[int, ...],
1543
+ out: None = None,
1544
+ keepdims: Literal[False] | _NoValueType = ...,
1545
+ initial: _NumberLike_co | _NoValueType = ...,
1546
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1547
+ ) -> NDArray[ScalarT]: ...
1548
+ @overload # +number | timedelta64 | datetime64 | object_, keepdims=True
1549
+ def amax[ArrayT: NDArray[np.number | np.bool | np.timedelta64 | np.datetime64 | np.object_]](
1550
+ a: ArrayT,
1551
+ axis: int | tuple[int, ...] | None = None,
1552
+ out: None = None,
1553
+ *,
1554
+ keepdims: Literal[True],
1555
+ initial: _NumberLike_co | _NoValueType = ...,
1556
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1557
+ ) -> ArrayT: ...
1558
+ @overload # object_
1559
+ def amax(
1560
+ a: _ArrayLike[np.object_],
1561
+ axis: None = None,
1562
+ out: None = None,
1563
+ keepdims: Literal[False] | _NoValueType = ...,
1564
+ initial: _NumberLike_co | _NoValueType = ...,
1565
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1566
+ ) -> Any: ...
1567
+ @overload # out: ArrayT
1568
+ def amax[ArrayT: np.ndarray](
1569
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1570
+ axis: int | tuple[int, ...] | None = None,
1571
+ *,
1572
+ out: ArrayT,
1573
+ keepdims: bool | _NoValueType = ...,
1574
+ initial: _NumberLike_co | _NoValueType = ...,
1575
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1576
+ ) -> ArrayT: ...
1577
+ @overload # fallback
1578
+ def amax(
1579
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1580
+ axis: None = None,
1581
+ out: None = None,
1582
+ keepdims: Literal[False] | _NoValueType = ...,
1583
+ initial: _NumberLike_co | _NoValueType = ...,
1584
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1585
+ ) -> Any: ...
1586
+ @overload # fallback, axis: <given>
1587
+ def amax(
1588
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1589
+ axis: int | tuple[int, ...],
1590
+ out: None = None,
1591
+ keepdims: Literal[False] | _NoValueType = ...,
1592
+ initial: _NumberLike_co | _NoValueType = ...,
1593
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1594
+ ) -> NDArray[Any]: ...
1595
+ @overload # fallback, keepdims=True
1596
+ def amax(
1597
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1598
+ axis: int | tuple[int, ...] | None = None,
1599
+ out: None = None,
1600
+ *,
1601
+ keepdims: Literal[True],
1602
+ initial: _NumberLike_co | _NoValueType = ...,
1603
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1604
+ ) -> NDArray[Any]: ...
1605
+
1606
+ max = amax
1607
+
1608
+ # keep in sync with `amax` above
1609
+ @overload # sequence of just `Any` (workaround)
1610
+ def amin(
1611
+ a: _NestedSequence[Never],
1612
+ axis: None = None,
1613
+ out: None = None,
1614
+ keepdims: Literal[False] | _NoValueType = ...,
1615
+ initial: _NumberLike_co | _NoValueType = ...,
1616
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1617
+ ) -> Any: ...
1618
+ @overload # builtins.bool
1619
+ def amin(
1620
+ a: _NestedSequence[bool],
1621
+ axis: None = None,
1622
+ out: None = None,
1623
+ keepdims: Literal[False] | _NoValueType = ...,
1624
+ initial: _NumberLike_co | _NoValueType = ...,
1625
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1626
+ ) -> np.bool: ...
1627
+ @overload # builtins.bool, axis: <given>
1628
+ def amin(
1629
+ a: _NestedSequence[bool],
1630
+ axis: int | tuple[int, ...],
1631
+ out: None = None,
1632
+ keepdims: Literal[False] | _NoValueType = ...,
1633
+ initial: _NumberLike_co | _NoValueType = ...,
1634
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1635
+ ) -> NDArray[np.bool]: ...
1636
+ @overload # builtins.bool, keepdims=True
1637
+ def amin(
1638
+ a: _NestedSequence[bool],
1639
+ axis: int | tuple[int, ...] | None = None,
1640
+ out: None = None,
1641
+ *,
1642
+ keepdims: Literal[True],
1643
+ initial: _NumberLike_co | _NoValueType = ...,
1644
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1645
+ ) -> NDArray[np.bool]: ...
1646
+ @overload # ~builtins.int
1647
+ def amin(
1648
+ a: _NestedSequence[list[int]] | list[int],
1649
+ axis: None = None,
1650
+ out: None = None,
1651
+ keepdims: Literal[False] | _NoValueType = ...,
1652
+ initial: _NumberLike_co | _NoValueType = ...,
1653
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1654
+ ) -> np.int_: ...
1655
+ @overload # ~builtins.int, axis: <given>
1656
+ def amin(
1657
+ a: _NestedSequence[list[int]] | list[int],
1658
+ axis: int | tuple[int, ...],
1659
+ out: None = None,
1660
+ keepdims: Literal[False] | _NoValueType = ...,
1661
+ initial: _NumberLike_co | _NoValueType = ...,
1662
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1663
+ ) -> NDArray[np.int_]: ...
1664
+ @overload # ~builtins.int, keepdims=True
1665
+ def amin(
1666
+ a: _NestedSequence[list[int]] | list[int],
1667
+ axis: int | tuple[int, ...] | None = None,
1668
+ out: None = None,
1669
+ *,
1670
+ keepdims: Literal[True],
1671
+ initial: _NumberLike_co | _NoValueType = ...,
1672
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1673
+ ) -> NDArray[np.int_]: ...
1674
+ @overload # ~builtins.float
1675
+ def amin(
1676
+ a: _NestedSequence[list[float]] | list[float],
1677
+ axis: None = None,
1678
+ out: None = None,
1679
+ keepdims: Literal[False] | _NoValueType = ...,
1680
+ initial: _NumberLike_co | _NoValueType = ...,
1681
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1682
+ ) -> np.float64: ...
1683
+ @overload # ~builtins.float, axis: <given>
1684
+ def amin(
1685
+ a: _NestedSequence[list[float]] | list[float],
1686
+ axis: int | tuple[int, ...],
1687
+ out: None = None,
1688
+ keepdims: Literal[False] | _NoValueType = ...,
1689
+ initial: _NumberLike_co | _NoValueType = ...,
1690
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1691
+ ) -> NDArray[np.float64]: ...
1692
+ @overload # ~builtins.float, keepdims=True
1693
+ def amin(
1694
+ a: _NestedSequence[list[float]] | list[float],
1695
+ axis: int | tuple[int, ...] | None = None,
1696
+ out: None = None,
1697
+ *,
1698
+ keepdims: Literal[True],
1699
+ initial: _NumberLike_co | _NoValueType = ...,
1700
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1701
+ ) -> NDArray[np.float64]: ...
1702
+ @overload # ~builtins.complex
1703
+ def amin(
1704
+ a: _NestedSequence[list[complex]] | list[complex],
1705
+ axis: None = None,
1706
+ out: None = None,
1707
+ keepdims: Literal[False] | _NoValueType = ...,
1708
+ initial: _NumberLike_co | _NoValueType = ...,
1709
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1710
+ ) -> np.complex128: ...
1711
+ @overload # ~builtins.complex, axis: <given>
1712
+ def amin(
1713
+ a: _NestedSequence[list[complex]] | list[complex],
1714
+ axis: int | tuple[int, ...],
1715
+ out: None = None,
1716
+ keepdims: Literal[False] | _NoValueType = ...,
1717
+ initial: _NumberLike_co | _NoValueType = ...,
1718
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1719
+ ) -> NDArray[np.complex128]: ...
1720
+ @overload # ~builtins.complex, keepdims=True
1721
+ def amin(
1722
+ a: _NestedSequence[list[complex]] | list[complex],
1723
+ axis: int | tuple[int, ...] | None = None,
1724
+ out: None = None,
1725
+ *,
1726
+ keepdims: Literal[True],
1727
+ initial: _NumberLike_co | _NoValueType = ...,
1728
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1729
+ ) -> NDArray[np.complex128]: ...
1730
+ @overload # +number | timedelta64 | datetime64
1731
+ def amin[ScalarT: np.number | np.bool | np.timedelta64 | np.datetime64](
1732
+ a: _ArrayLike[ScalarT],
1733
+ axis: None = None,
1734
+ out: None = None,
1735
+ keepdims: Literal[False] | _NoValueType = ...,
1736
+ initial: _NumberLike_co | _NoValueType = ...,
1737
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1738
+ ) -> ScalarT: ...
1739
+ @overload # +number | timedelta64 | datetime64 | object_, axis: <given>
1740
+ def amin[ScalarT: np.number | np.bool | np.timedelta64 | np.datetime64 | np.object_](
1741
+ a: _ArrayLike[ScalarT],
1742
+ axis: int | tuple[int, ...],
1743
+ out: None = None,
1744
+ keepdims: Literal[False] | _NoValueType = ...,
1745
+ initial: _NumberLike_co | _NoValueType = ...,
1746
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1747
+ ) -> NDArray[ScalarT]: ...
1748
+ @overload # +number | timedelta64 | datetime64 | object_, keepdims=True
1749
+ def amin[ArrayT: NDArray[np.number | np.bool | np.timedelta64 | np.datetime64 | np.object_]](
1750
+ a: ArrayT,
1751
+ axis: int | tuple[int, ...] | None = None,
1752
+ out: None = None,
1753
+ *,
1754
+ keepdims: Literal[True],
1755
+ initial: _NumberLike_co | _NoValueType = ...,
1756
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1757
+ ) -> ArrayT: ...
1758
+ @overload # object_
1759
+ def amin(
1760
+ a: _ArrayLike[np.object_],
1761
+ axis: None = None,
1762
+ out: None = None,
1763
+ keepdims: Literal[False] | _NoValueType = ...,
1764
+ initial: _NumberLike_co | _NoValueType = ...,
1765
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1766
+ ) -> Any: ...
1767
+ @overload # out: ArrayT
1768
+ def amin[ArrayT: np.ndarray](
1769
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1770
+ axis: int | tuple[int, ...] | None = None,
1771
+ *,
1772
+ out: ArrayT,
1773
+ keepdims: bool | _NoValueType = ...,
1774
+ initial: _NumberLike_co | _NoValueType = ...,
1775
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1776
+ ) -> ArrayT: ...
1777
+ @overload # fallback
1778
+ def amin(
1779
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1780
+ axis: None = None,
1781
+ out: None = None,
1782
+ keepdims: Literal[False] | _NoValueType = ...,
1783
+ initial: _NumberLike_co | _NoValueType = ...,
1784
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1785
+ ) -> Any: ...
1786
+ @overload # fallback, axis: <given>
1787
+ def amin(
1788
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1789
+ axis: int | tuple[int, ...],
1790
+ out: None = None,
1791
+ keepdims: Literal[False] | _NoValueType = ...,
1792
+ initial: _NumberLike_co | _NoValueType = ...,
1793
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1794
+ ) -> NDArray[Any]: ...
1795
+ @overload # fallback, keepdims=True
1796
+ def amin(
1797
+ a: _ArrayLikeNumeric_co | _NestedSequence[_Orderable],
1798
+ axis: int | tuple[int, ...] | None = None,
1799
+ out: None = None,
1800
+ *,
1801
+ keepdims: Literal[True],
1802
+ initial: _NumberLike_co | _NoValueType = ...,
1803
+ where: _ArrayLikeBool_co | _NoValueType = ...,
1804
+ ) -> NDArray[Any]: ...
1805
+
1806
+ min = amin
1807
+
1808
+ # keep in sync with `cumsum` above (minus `timedelta64` and `StringDType`)
1809
+ @overload
1810
+ def cumprod[ScalarT: np.inexact | np.object_](
1811
+ a: _ArrayLike[ScalarT],
1812
+ axis: None = None,
1813
+ dtype: None = None,
1814
+ out: None = None,
1815
+ ) -> _Array1D[ScalarT]: ...
1816
+ @overload
1817
+ def cumprod[ArrayT: NDArray[np.inexact | np.object_]](
1818
+ a: ArrayT,
1819
+ axis: SupportsIndex,
1820
+ dtype: None = None,
1821
+ out: None = None,
1822
+ ) -> ArrayT: ...
1823
+ @overload
1824
+ def cumprod[ScalarT: np.inexact | np.object_](
1825
+ a: _ArrayLike[ScalarT],
1826
+ axis: SupportsIndex,
1827
+ dtype: None = None,
1828
+ out: None = None,
1829
+ ) -> NDArray[ScalarT]: ...
1830
+ @overload
1831
+ def cumprod(
1832
+ a: _ArrayLikeInt_co,
1833
+ axis: None = None,
1834
+ dtype: None = None,
1835
+ out: None = None,
1836
+ ) -> _Array1D[np.int_]: ...
1837
+ @overload
1838
+ def cumprod[ShapeT: _Shape](
1839
+ a: np.ndarray[ShapeT, np.dtype[np.bool | np.integer]],
1840
+ axis: SupportsIndex,
1841
+ dtype: None = None,
1842
+ out: None = None,
1843
+ ) -> np.ndarray[ShapeT, np.dtype[np.int_]]: ...
1844
+ @overload
1845
+ def cumprod(
1846
+ a: _ArrayLikeInt_co,
1847
+ axis: SupportsIndex,
1848
+ dtype: None = None,
1849
+ out: None = None,
1850
+ ) -> NDArray[np.int_]: ...
1851
+ @overload
1852
+ def cumprod(
1853
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1854
+ axis: None = None,
1855
+ dtype: None = None,
1856
+ out: None = None,
1857
+ ) -> _Array1D[Any]: ...
1858
+ @overload
1859
+ def cumprod(
1860
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1861
+ axis: SupportsIndex,
1862
+ dtype: None = None,
1863
+ out: None = None,
1864
+ ) -> NDArray[Any]: ...
1865
+ @overload
1866
+ def cumprod[ScalarT: np.number | np.bool | np.object_](
1867
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1868
+ axis: None,
1869
+ dtype: _DTypeLike[ScalarT],
1870
+ out: None = None,
1871
+ ) -> _Array1D[ScalarT]: ...
1872
+ @overload
1873
+ def cumprod[ScalarT: np.number | np.bool | np.object_](
1874
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1875
+ axis: None = None,
1876
+ *,
1877
+ dtype: _DTypeLike[ScalarT],
1878
+ out: None = None,
1879
+ ) -> _Array1D[ScalarT]: ...
1880
+ @overload
1881
+ def cumprod[ScalarT: np.number | np.bool | np.object_](
1882
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1883
+ axis: SupportsIndex,
1884
+ dtype: _DTypeLike[ScalarT],
1885
+ out: None = None,
1886
+ ) -> NDArray[ScalarT]: ...
1887
+ @overload
1888
+ def cumprod(
1889
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1890
+ axis: None = None,
1891
+ dtype: DTypeLike | None = None,
1892
+ out: None = None,
1893
+ ) -> _Array1D[Any]: ...
1894
+ @overload
1895
+ def cumprod(
1896
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1897
+ axis: SupportsIndex,
1898
+ dtype: DTypeLike | None = None,
1899
+ out: None = None,
1900
+ ) -> NDArray[Any]: ...
1901
+ @overload
1902
+ def cumprod[ArrayT: np.ndarray](
1903
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1904
+ axis: SupportsIndex | None,
1905
+ dtype: DTypeLike | None,
1906
+ out: ArrayT,
1907
+ ) -> ArrayT: ...
1908
+ @overload
1909
+ def cumprod[ArrayT: np.ndarray](
1910
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1911
+ axis: SupportsIndex | None = None,
1912
+ dtype: DTypeLike | None = None,
1913
+ *,
1914
+ out: ArrayT,
1915
+ ) -> ArrayT: ...
1916
+
1917
+ # keep in sync with `cumulative_sum` above (minus `timedelta64` and `StringDType`)
1918
+ @overload
1919
+ def cumulative_prod[ScalarT: np.inexact | np.object_](
1920
+ x: _ArrayLike[ScalarT],
1921
+ /,
1922
+ *,
1923
+ axis: None = None,
1924
+ dtype: None = None,
1925
+ out: None = None,
1926
+ include_initial: bool = False,
1927
+ ) -> _Array1D[ScalarT]: ...
1928
+ @overload
1929
+ def cumulative_prod[ArrayT: NDArray[np.inexact | np.object_]](
1930
+ x: ArrayT,
1931
+ /,
1932
+ *,
1933
+ axis: SupportsIndex,
1934
+ dtype: None = None,
1935
+ out: None = None,
1936
+ include_initial: bool = False,
1937
+ ) -> ArrayT: ...
1938
+ @overload
1939
+ def cumulative_prod[ScalarT: np.inexact | np.object_](
1940
+ x: _ArrayLike[ScalarT],
1941
+ /,
1942
+ *,
1943
+ axis: SupportsIndex,
1944
+ dtype: None = None,
1945
+ out: None = None,
1946
+ include_initial: bool = False,
1947
+ ) -> NDArray[ScalarT]: ...
1948
+ @overload
1949
+ def cumulative_prod(
1950
+ x: _ArrayLikeInt_co,
1951
+ /,
1952
+ *,
1953
+ axis: None = None,
1954
+ dtype: None = None,
1955
+ out: None = None,
1956
+ include_initial: bool = False,
1957
+ ) -> _Array1D[np.int_]: ...
1958
+ @overload
1959
+ def cumulative_prod[ShapeT: _Shape](
1960
+ x: np.ndarray[ShapeT, np.dtype[np.bool | np.integer]],
1961
+ /,
1962
+ *,
1963
+ axis: SupportsIndex,
1964
+ dtype: None = None,
1965
+ out: None = None,
1966
+ include_initial: bool = False,
1967
+ ) -> np.ndarray[ShapeT, np.dtype[np.int_]]: ...
1968
+ @overload
1969
+ def cumulative_prod(
1970
+ x: _ArrayLikeInt_co,
1971
+ /,
1972
+ *,
1973
+ axis: SupportsIndex,
1974
+ dtype: None = None,
1975
+ out: None = None,
1976
+ include_initial: bool = False,
1977
+ ) -> NDArray[np.int_]: ...
1978
+ @overload
1979
+ def cumulative_prod(
1980
+ x: ArrayLike,
1981
+ /,
1982
+ *,
1983
+ axis: None = None,
1984
+ dtype: None = None,
1985
+ out: None = None,
1986
+ include_initial: bool = False,
1987
+ ) -> _Array1D[Any]: ...
1988
+ @overload
1989
+ def cumulative_prod(
1990
+ x: _ArrayLikeComplex_co | _ArrayLikeObject_co,
1991
+ /,
1992
+ *,
1993
+ axis: SupportsIndex,
1994
+ dtype: None = None,
1995
+ out: None = None,
1996
+ include_initial: bool = False,
1997
+ ) -> NDArray[Any]: ...
1998
+ @overload
1999
+ def cumulative_prod[ScalarT: np.number | np.bool | np.object_](
2000
+ x: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2001
+ /,
2002
+ *,
2003
+ axis: None = None,
2004
+ dtype: _DTypeLike[ScalarT],
2005
+ out: None = None,
2006
+ include_initial: bool = False,
2007
+ ) -> _Array1D[ScalarT]: ...
2008
+ @overload
2009
+ def cumulative_prod[ScalarT: np.number | np.bool | np.object_](
2010
+ x: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2011
+ /,
2012
+ *,
2013
+ axis: SupportsIndex,
2014
+ dtype: _DTypeLike[ScalarT],
2015
+ out: None = None,
2016
+ include_initial: bool = False,
2017
+ ) -> NDArray[ScalarT]: ...
2018
+ @overload
2019
+ def cumulative_prod(
2020
+ x: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2021
+ /,
2022
+ *,
2023
+ axis: None = None,
2024
+ dtype: DTypeLike | None = None,
2025
+ out: None = None,
2026
+ include_initial: bool = False,
2027
+ ) -> _Array1D[Any]: ...
2028
+ @overload
2029
+ def cumulative_prod(
2030
+ x: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2031
+ /,
2032
+ *,
2033
+ axis: SupportsIndex,
2034
+ dtype: DTypeLike | None = None,
2035
+ out: None = None,
2036
+ include_initial: bool = False,
2037
+ ) -> NDArray[Any]: ...
2038
+ @overload
2039
+ def cumulative_prod[ArrayT: np.ndarray](
2040
+ x: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2041
+ /,
2042
+ *,
2043
+ axis: SupportsIndex | None = None,
2044
+ dtype: DTypeLike | None = None,
2045
+ out: ArrayT,
2046
+ include_initial: bool = False,
2047
+ ) -> ArrayT: ...
2048
+
2049
+ def ndim(a: ArrayLike) -> int: ...
2050
+
2051
+ def size(a: ArrayLike, axis: int | tuple[int, ...] | None = None) -> int: ...
2052
+
2053
+ # TODO: Fix overlapping overloads: https://github.com/numpy/numpy/issues/27032
2054
+ @overload
2055
+ def around(
2056
+ a: _BoolLike_co,
2057
+ decimals: SupportsIndex = 0,
2058
+ out: None = None,
2059
+ ) -> float16: ...
2060
+ @overload
2061
+ def around[ScalarOrArrayT: np.number | np.object_ | NDArray[np.number | np.object_]](
2062
+ a: ScalarOrArrayT,
2063
+ decimals: SupportsIndex = 0,
2064
+ out: None = None,
2065
+ ) -> ScalarOrArrayT: ...
2066
+ @overload
2067
+ def around(
2068
+ a: _ComplexLike_co | object_,
2069
+ decimals: SupportsIndex = 0,
2070
+ out: None = None,
2071
+ ) -> Any: ...
2072
+ @overload
2073
+ def around(
2074
+ a: _ArrayLikeBool_co,
2075
+ decimals: SupportsIndex = 0,
2076
+ out: None = None,
2077
+ ) -> NDArray[float16]: ...
2078
+ @overload
2079
+ def around[NumberOrObjectT: np.number | np.object_](
2080
+ a: _ArrayLike[NumberOrObjectT],
2081
+ decimals: SupportsIndex = 0,
2082
+ out: None = None,
2083
+ ) -> NDArray[NumberOrObjectT]: ...
2084
+ @overload
2085
+ def around(
2086
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2087
+ decimals: SupportsIndex = 0,
2088
+ out: None = None,
2089
+ ) -> NDArray[Any]: ...
2090
+ @overload
2091
+ def around[ArrayT: np.ndarray](
2092
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2093
+ decimals: SupportsIndex,
2094
+ out: ArrayT,
2095
+ ) -> ArrayT: ...
2096
+ @overload
2097
+ def around[ArrayT: np.ndarray](
2098
+ a: _ArrayLikeComplex_co | _ArrayLikeObject_co,
2099
+ decimals: SupportsIndex = 0,
2100
+ *,
2101
+ out: ArrayT,
2102
+ ) -> ArrayT: ...
2103
+
2104
+ # keep in sync with `sum` below (but without `timedelta64`)
2105
+ @overload # ~builtins.float
2106
+ def prod(
2107
+ a: _NestedSequence[list[float]] | list[float],
2108
+ axis: None = None,
2109
+ dtype: None = None,
2110
+ out: None = None,
2111
+ keepdims: Literal[False] | _NoValueType = ...,
2112
+ initial: _FloatLike_co | _NoValueType = ...,
2113
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2114
+ ) -> np.float64: ...
2115
+ @overload # ~builtins.float, axis: <given>
2116
+ def prod(
2117
+ a: _NestedSequence[list[float]] | list[float],
2118
+ axis: int | tuple[int, ...],
2119
+ dtype: None = None,
2120
+ out: None = None,
2121
+ keepdims: Literal[False] | _NoValueType = ...,
2122
+ initial: _FloatLike_co | _NoValueType = ...,
2123
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2124
+ ) -> NDArray[np.float64]: ...
2125
+ @overload # ~builtins.float, keepdims=True
2126
+ def prod(
2127
+ a: _NestedSequence[list[float]] | list[float],
2128
+ axis: int | tuple[int, ...] | None = None,
2129
+ dtype: None = None,
2130
+ out: None = None,
2131
+ *,
2132
+ keepdims: Literal[True],
2133
+ initial: _FloatLike_co | _NoValueType = ...,
2134
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2135
+ ) -> NDArray[np.float64]: ...
2136
+ @overload # ~builtins.complex
2137
+ def prod(
2138
+ a: _NestedSequence[list[complex]] | list[complex],
2139
+ axis: None = None,
2140
+ dtype: None = None,
2141
+ out: None = None,
2142
+ keepdims: Literal[False] | _NoValueType = ...,
2143
+ initial: _NumberLike_co | _NoValueType = ...,
2144
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2145
+ ) -> np.complex128: ...
2146
+ @overload # ~builtins.complex, axis: <given>
2147
+ def prod(
2148
+ a: _NestedSequence[list[complex]] | list[complex],
2149
+ axis: int | tuple[int, ...],
2150
+ dtype: None = None,
2151
+ out: None = None,
2152
+ keepdims: Literal[False] | _NoValueType = ...,
2153
+ initial: _NumberLike_co | _NoValueType = ...,
2154
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2155
+ ) -> NDArray[np.complex128]: ...
2156
+ @overload # ~builtins.complex, keepdims=True
2157
+ def prod(
2158
+ a: _NestedSequence[list[complex]] | list[complex],
2159
+ axis: int | tuple[int, ...] | None = None,
2160
+ dtype: None = None,
2161
+ out: None = None,
2162
+ *,
2163
+ keepdims: Literal[True],
2164
+ initial: _NumberLike_co | _NoValueType = ...,
2165
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2166
+ ) -> NDArray[np.complex128]: ...
2167
+ @overload # ~inexact
2168
+ def prod[ScalarT: np.inexact](
2169
+ a: _ArrayLike[ScalarT],
2170
+ axis: None = None,
2171
+ dtype: None = None,
2172
+ out: None = None,
2173
+ keepdims: Literal[False] | _NoValueType = ...,
2174
+ initial: _NumberLike_co | _NoValueType = ...,
2175
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2176
+ ) -> ScalarT: ...
2177
+ @overload # ~inexact | timedelta64 | object_, axis: <given>
2178
+ def prod[ScalarT: np.inexact | np.object_](
2179
+ a: _ArrayLike[ScalarT],
2180
+ axis: int | tuple[int, ...],
2181
+ dtype: None = None,
2182
+ out: None = None,
2183
+ keepdims: Literal[False] | _NoValueType = ...,
2184
+ initial: _NumberLike_co | _NoValueType = ...,
2185
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2186
+ ) -> NDArray[ScalarT]: ...
2187
+ @overload # ~inexact | object_, keepdims=True
2188
+ def prod[ArrayT: NDArray[np.inexact | np.object_]](
2189
+ a: ArrayT,
2190
+ axis: int | tuple[int, ...] | None = None,
2191
+ dtype: None = None,
2192
+ out: None = None,
2193
+ *,
2194
+ keepdims: Literal[True],
2195
+ initial: _NumberLike_co | _NoValueType = ...,
2196
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2197
+ ) -> ArrayT: ...
2198
+ @overload # bool | integer | +builtins.int
2199
+ def prod(
2200
+ a: _DualArrayLike[np.dtype[np.bool | np.integer], int],
2201
+ axis: None = None,
2202
+ dtype: None = None,
2203
+ out: None = None,
2204
+ keepdims: Literal[False] | _NoValueType = ...,
2205
+ initial: _IntLike_co | _NoValueType = ...,
2206
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2207
+ ) -> np.int_: ...
2208
+ @overload # bool | np.integer | +builtins.int, axis: <given>
2209
+ def prod(
2210
+ a: _DualArrayLike[np.dtype[np.bool | np.integer], int],
2211
+ axis: int | tuple[int, ...],
2212
+ dtype: None = None,
2213
+ out: None = None,
2214
+ keepdims: Literal[False] | _NoValueType = ...,
2215
+ initial: _IntLike_co | _NoValueType = ...,
2216
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2217
+ ) -> NDArray[np.int_]: ...
2218
+ @overload # bool | np.integer, keepdims=True
2219
+ def prod[ShapeT: _Shape](
2220
+ a: np.ndarray[ShapeT, np.dtype[np.bool | np.integer]],
2221
+ axis: int | tuple[int, ...] | None = None,
2222
+ dtype: None = None,
2223
+ out: None = None,
2224
+ *,
2225
+ keepdims: Literal[True],
2226
+ initial: _IntLike_co | _NoValueType = ...,
2227
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2228
+ ) -> np.ndarray[ShapeT, np.dtype[np.int_]]: ...
2229
+ @overload # object_
2230
+ def prod(
2231
+ a: _SupportsArray[np.dtype[np.object_]],
2232
+ axis: None = None,
2233
+ dtype: None = None,
2234
+ out: None = None,
2235
+ keepdims: Literal[False] | _NoValueType = ...,
2236
+ initial: _NumberLike_co | _NoValueType = ...,
2237
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2238
+ ) -> Any: ...
2239
+ @overload # dtype: ScalarT
2240
+ def prod[ScalarT: np.generic](
2241
+ a: _ArrayLikeNumeric_co,
2242
+ axis: None = None,
2243
+ *,
2244
+ dtype: _DTypeLike[ScalarT],
2245
+ out: None = None,
2246
+ keepdims: Literal[False] | _NoValueType = ...,
2247
+ initial: _NumberLike_co | _NoValueType = ...,
2248
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2249
+ ) -> ScalarT: ...
2250
+ @overload # dtype: ScalarT (keyword), keepdims=True
2251
+ def prod[ShapeT: _Shape, ScalarT: np.generic](
2252
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.object_]],
2253
+ axis: int | tuple[int, ...] | None = None,
2254
+ *,
2255
+ dtype: _DTypeLike[ScalarT],
2256
+ out: None = None,
2257
+ keepdims: Literal[True],
2258
+ initial: _NumberLike_co | _NoValueType = ...,
2259
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2260
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2261
+ @overload # dtype: ScalarT (positional), keepdims=True
2262
+ def prod[ShapeT: _Shape, ScalarT: np.generic](
2263
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.object_]],
2264
+ axis: int | tuple[int, ...] | None,
2265
+ dtype: _DTypeLike[ScalarT],
2266
+ out: None = None,
2267
+ *,
2268
+ keepdims: Literal[True],
2269
+ initial: _NumberLike_co | _NoValueType = ...,
2270
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2271
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2272
+ @overload # dtype: ScalarT (keyword), keepdims=True
2273
+ def prod[ScalarT: np.generic](
2274
+ a: _ArrayLikeMultiplicative_co,
2275
+ axis: int | tuple[int, ...] | None = None,
2276
+ *,
2277
+ dtype: _DTypeLike[ScalarT],
2278
+ out: None = None,
2279
+ keepdims: Literal[True],
2280
+ initial: _NumberLike_co | _NoValueType = ...,
2281
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2282
+ ) -> NDArray[ScalarT]: ...
2283
+ @overload # axis: <given>, dtype: ScalarT
2284
+ def prod[ScalarT: np.generic](
2285
+ a: _ArrayLikeMultiplicative_co,
2286
+ axis: int | tuple[int, ...],
2287
+ dtype: _DTypeLike[ScalarT],
2288
+ out: None = None,
2289
+ keepdims: Literal[False] | _NoValueType = ...,
2290
+ initial: _NumberLike_co | _NoValueType = ...,
2291
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2292
+ ) -> NDArray[ScalarT]: ...
2293
+ @overload # out: ArrayT (keyword)
2294
+ def prod[ArrayT: np.ndarray](
2295
+ a: _ArrayLikeMultiplicative_co,
2296
+ axis: int | tuple[int, ...] | None = None,
2297
+ dtype: DTypeLike | None = None,
2298
+ *,
2299
+ out: ArrayT,
2300
+ keepdims: bool | _NoValueType = ...,
2301
+ initial: _NumberLike_co | _NoValueType = ...,
2302
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2303
+ ) -> ArrayT: ...
2304
+ @overload # out: ArrayT (positional)
2305
+ def prod[ArrayT: np.ndarray](
2306
+ a: _ArrayLikeMultiplicative_co,
2307
+ axis: int | tuple[int, ...] | None,
2308
+ dtype: DTypeLike | None,
2309
+ out: ArrayT,
2310
+ keepdims: bool | _NoValueType = ...,
2311
+ initial: _NumberLike_co | _NoValueType = ...,
2312
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2313
+ ) -> ArrayT: ...
2314
+ @overload # fallback
2315
+ def prod(
2316
+ a: _ArrayLikeMultiplicative_co,
2317
+ axis: None = None,
2318
+ dtype: DTypeLike | None = None,
2319
+ out: None = None,
2320
+ keepdims: Literal[False] | _NoValueType = ...,
2321
+ initial: _NumberLike_co | _NoValueType = ...,
2322
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2323
+ ) -> Any: ...
2324
+ @overload # fallback, axis: <given>
2325
+ def prod(
2326
+ a: _ArrayLikeMultiplicative_co,
2327
+ axis: int | tuple[int, ...],
2328
+ dtype: DTypeLike | None = None,
2329
+ out: None = None,
2330
+ keepdims: Literal[False] | _NoValueType = ...,
2331
+ initial: _NumberLike_co | _NoValueType = ...,
2332
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2333
+ ) -> NDArray[Any]: ...
2334
+ @overload # fallback, keepdims=True
2335
+ def prod(
2336
+ a: _ArrayLikeMultiplicative_co,
2337
+ axis: int | tuple[int, ...] | None = None,
2338
+ dtype: DTypeLike | None = None,
2339
+ out: None = None,
2340
+ *,
2341
+ keepdims: Literal[True],
2342
+ initial: _NumberLike_co | _NoValueType = ...,
2343
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2344
+ ) -> NDArray[Any]: ...
2345
+
2346
+ # keep in sync with `prod` above (but also accept `timedelta64`)
2347
+ @overload # ~builtins.float
2348
+ def sum(
2349
+ a: _NestedSequence[list[float]] | list[float],
2350
+ axis: None = None,
2351
+ dtype: None = None,
2352
+ out: None = None,
2353
+ keepdims: Literal[False] | _NoValueType = ...,
2354
+ initial: _FloatLike_co | _NoValueType = ...,
2355
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2356
+ ) -> np.float64: ...
2357
+ @overload # ~builtins.float, axis: <given>
2358
+ def sum(
2359
+ a: _NestedSequence[list[float]] | list[float],
2360
+ axis: int | tuple[int, ...],
2361
+ dtype: None = None,
2362
+ out: None = None,
2363
+ keepdims: Literal[False] | _NoValueType = ...,
2364
+ initial: _FloatLike_co | _NoValueType = ...,
2365
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2366
+ ) -> NDArray[np.float64]: ...
2367
+ @overload # ~builtins.float, keepdims=True
2368
+ def sum(
2369
+ a: _NestedSequence[list[float]] | list[float],
2370
+ axis: int | tuple[int, ...] | None = None,
2371
+ dtype: None = None,
2372
+ out: None = None,
2373
+ *,
2374
+ keepdims: Literal[True],
2375
+ initial: _FloatLike_co | _NoValueType = ...,
2376
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2377
+ ) -> NDArray[np.float64]: ...
2378
+ @overload # ~builtins.complex
2379
+ def sum(
2380
+ a: _NestedSequence[list[complex]] | list[complex],
2381
+ axis: None = None,
2382
+ dtype: None = None,
2383
+ out: None = None,
2384
+ keepdims: Literal[False] | _NoValueType = ...,
2385
+ initial: _NumberLike_co | _NoValueType = ...,
2386
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2387
+ ) -> np.complex128: ...
2388
+ @overload # ~builtins.complex, axis: <given>
2389
+ def sum(
2390
+ a: _NestedSequence[list[complex]] | list[complex],
2391
+ axis: int | tuple[int, ...],
2392
+ dtype: None = None,
2393
+ out: None = None,
2394
+ keepdims: Literal[False] | _NoValueType = ...,
2395
+ initial: _NumberLike_co | _NoValueType = ...,
2396
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2397
+ ) -> NDArray[np.complex128]: ...
2398
+ @overload # ~builtins.complex, keepdims=True
2399
+ def sum(
2400
+ a: _NestedSequence[list[complex]] | list[complex],
2401
+ axis: int | tuple[int, ...] | None = None,
2402
+ dtype: None = None,
2403
+ out: None = None,
2404
+ *,
2405
+ keepdims: Literal[True],
2406
+ initial: _NumberLike_co | _NoValueType = ...,
2407
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2408
+ ) -> NDArray[np.complex128]: ...
2409
+ @overload # ~inexact | timedelta64
2410
+ def sum[ScalarT: np.inexact | np.timedelta64](
2411
+ a: _ArrayLike[ScalarT],
2412
+ axis: None = None,
2413
+ dtype: None = None,
2414
+ out: None = None,
2415
+ keepdims: Literal[False] | _NoValueType = ...,
2416
+ initial: _NumberLike_co | _NoValueType = ...,
2417
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2418
+ ) -> ScalarT: ...
2419
+ @overload # ~inexact | timedelta64 | object_, axis: <given>
2420
+ def sum[ScalarT: np.inexact | np.timedelta64 | np.object_](
2421
+ a: _ArrayLike[ScalarT],
2422
+ axis: int | tuple[int, ...],
2423
+ dtype: None = None,
2424
+ out: None = None,
2425
+ keepdims: Literal[False] | _NoValueType = ...,
2426
+ initial: _NumberLike_co | _NoValueType = ...,
2427
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2428
+ ) -> NDArray[ScalarT]: ...
2429
+ @overload # ~number | timedelta64 | object_, keepdims=True
2430
+ def sum[ArrayT: NDArray[np.inexact | np.timedelta64 | np.object_]](
2431
+ a: ArrayT,
2432
+ axis: int | tuple[int, ...] | None = None,
2433
+ dtype: None = None,
2434
+ out: None = None,
2435
+ *,
2436
+ keepdims: Literal[True],
2437
+ initial: _NumberLike_co | _NoValueType = ...,
2438
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2439
+ ) -> ArrayT: ...
2440
+ @overload # bool | integer | +builtins.int
2441
+ def sum(
2442
+ a: _DualArrayLike[np.dtype[np.bool | np.integer], int],
2443
+ axis: None = None,
2444
+ dtype: None = None,
2445
+ out: None = None,
2446
+ keepdims: Literal[False] | _NoValueType = ...,
2447
+ initial: _IntLike_co | _NoValueType = ...,
2448
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2449
+ ) -> np.int_: ...
2450
+ @overload # bool | integer | +builtins.int, axis: <given>
2451
+ def sum(
2452
+ a: _DualArrayLike[np.dtype[np.bool | np.integer], int],
2453
+ axis: int | tuple[int, ...],
2454
+ dtype: None = None,
2455
+ out: None = None,
2456
+ keepdims: Literal[False] | _NoValueType = ...,
2457
+ initial: _IntLike_co | _NoValueType = ...,
2458
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2459
+ ) -> NDArray[np.int_]: ...
2460
+ @overload # bool | integer, keepdims=True
2461
+ def sum[ShapeT: _Shape](
2462
+ a: np.ndarray[ShapeT, np.dtype[np.bool | np.integer]],
2463
+ axis: int | tuple[int, ...] | None = None,
2464
+ dtype: None = None,
2465
+ out: None = None,
2466
+ *,
2467
+ keepdims: Literal[True],
2468
+ initial: _IntLike_co | _NoValueType = ...,
2469
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2470
+ ) -> np.ndarray[ShapeT, np.dtype[np.int_]]: ...
2471
+ @overload # object_
2472
+ def sum(
2473
+ a: _SupportsArray[np.dtype[np.object_]],
2474
+ axis: None = None,
2475
+ dtype: None = None,
2476
+ out: None = None,
2477
+ keepdims: Literal[False] | _NoValueType = ...,
2478
+ initial: _NumberLike_co | _NoValueType = ...,
2479
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2480
+ ) -> Any: ...
2481
+ @overload # dtype: ScalarT
2482
+ def sum[ScalarT: np.generic](
2483
+ a: _ArrayLikeNumeric_co,
2484
+ axis: None = None,
2485
+ *,
2486
+ dtype: _DTypeLike[ScalarT],
2487
+ out: None = None,
2488
+ keepdims: Literal[False] | _NoValueType = ...,
2489
+ initial: _NumberLike_co | _NoValueType = ...,
2490
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2491
+ ) -> ScalarT: ...
2492
+ @overload # dtype: ScalarT (keyword), keepdims=True
2493
+ def sum[ShapeT: _Shape, ScalarT: np.generic](
2494
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
2495
+ axis: int | tuple[int, ...] | None = None,
2496
+ *,
2497
+ dtype: _DTypeLike[ScalarT],
2498
+ out: None = None,
2499
+ keepdims: Literal[True],
2500
+ initial: _NumberLike_co | _NoValueType = ...,
2501
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2502
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2503
+ @overload # dtype: ScalarT (positional), keepdims=True
2504
+ def sum[ShapeT: _Shape, ScalarT: np.generic](
2505
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
2506
+ axis: int | tuple[int, ...] | None,
2507
+ dtype: _DTypeLike[ScalarT],
2508
+ out: None = None,
2509
+ *,
2510
+ keepdims: Literal[True],
2511
+ initial: _NumberLike_co | _NoValueType = ...,
2512
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2513
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2514
+ @overload # dtype: ScalarT (keyword), keepdims=True
2515
+ def sum[ScalarT: np.generic](
2516
+ a: _ArrayLikeNumeric_co,
2517
+ axis: int | tuple[int, ...] | None = None,
2518
+ *,
2519
+ dtype: _DTypeLike[ScalarT],
2520
+ out: None = None,
2521
+ keepdims: Literal[True],
2522
+ initial: _NumberLike_co | _NoValueType = ...,
2523
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2524
+ ) -> NDArray[ScalarT]: ...
2525
+ @overload # axis: <given>, dtype: ScalarT
2526
+ def sum[ScalarT: np.generic](
2527
+ a: _ArrayLikeNumeric_co,
2528
+ axis: int | tuple[int, ...],
2529
+ dtype: _DTypeLike[ScalarT],
2530
+ out: None = None,
2531
+ keepdims: Literal[False] | _NoValueType = ...,
2532
+ initial: _NumberLike_co | _NoValueType = ...,
2533
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2534
+ ) -> NDArray[ScalarT]: ...
2535
+ @overload # out: ArrayT (keyword)
2536
+ def sum[ArrayT: np.ndarray](
2537
+ a: _ArrayLikeNumeric_co,
2538
+ axis: int | tuple[int, ...] | None = None,
2539
+ dtype: DTypeLike | None = None,
2540
+ *,
2541
+ out: ArrayT,
2542
+ keepdims: bool | _NoValueType = ...,
2543
+ initial: _NumberLike_co | _NoValueType = ...,
2544
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2545
+ ) -> ArrayT: ...
2546
+ @overload # out: ArrayT (positional)
2547
+ def sum[ArrayT: np.ndarray](
2548
+ a: _ArrayLikeNumeric_co,
2549
+ axis: int | tuple[int, ...] | None,
2550
+ dtype: DTypeLike | None,
2551
+ out: ArrayT,
2552
+ keepdims: bool | _NoValueType = ...,
2553
+ initial: _NumberLike_co | _NoValueType = ...,
2554
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2555
+ ) -> ArrayT: ...
2556
+ @overload # fallback
2557
+ def sum(
2558
+ a: _ArrayLikeNumeric_co,
2559
+ axis: None = None,
2560
+ dtype: DTypeLike | None = None,
2561
+ out: None = None,
2562
+ keepdims: Literal[False] | _NoValueType = ...,
2563
+ initial: _NumberLike_co | _NoValueType = ...,
2564
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2565
+ ) -> Any: ...
2566
+ @overload # fallback, axis: <given>
2567
+ def sum(
2568
+ a: _ArrayLikeNumeric_co,
2569
+ axis: int | tuple[int, ...],
2570
+ dtype: DTypeLike | None = None,
2571
+ out: None = None,
2572
+ keepdims: Literal[False] | _NoValueType = ...,
2573
+ initial: _NumberLike_co | _NoValueType = ...,
2574
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2575
+ ) -> NDArray[Any]: ...
2576
+ @overload # fallback, keepdims=True
2577
+ def sum(
2578
+ a: _ArrayLikeNumeric_co,
2579
+ axis: int | tuple[int, ...] | None = None,
2580
+ dtype: DTypeLike | None = None,
2581
+ out: None = None,
2582
+ *,
2583
+ keepdims: Literal[True],
2584
+ initial: _NumberLike_co | _NoValueType = ...,
2585
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2586
+ ) -> NDArray[Any]: ...
2587
+
2588
+ #
2589
+ @overload # +integer | ~object_ | +builtins.float
2590
+ def mean(
2591
+ a: _DualArrayLike[np.dtype[np.integer | np.bool | np.object_], float],
2592
+ axis: None = None,
2593
+ dtype: None = None,
2594
+ out: None = None,
2595
+ keepdims: Literal[False] | _NoValueType = ...,
2596
+ *,
2597
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2598
+ ) -> np.float64: ...
2599
+ @overload # +integer | +builtins.float, axis: <given>
2600
+ def mean(
2601
+ a: _DualArrayLike[np.dtype[np.integer | np.bool], float],
2602
+ axis: int | tuple[int, ...],
2603
+ dtype: None = None,
2604
+ out: None = None,
2605
+ keepdims: Literal[False] | _NoValueType = ...,
2606
+ *,
2607
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2608
+ ) -> NDArray[np.float64]: ...
2609
+ @overload # +integer, keepdims=True
2610
+ def mean[ShapeT: _Shape](
2611
+ a: np.ndarray[ShapeT, np.dtype[np.integer | np.bool]],
2612
+ axis: int | tuple[int, ...] | None = None,
2613
+ dtype: None = None,
2614
+ out: None = None,
2615
+ *,
2616
+ keepdims: Literal[True],
2617
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2618
+ ) -> np.ndarray[ShapeT, np.dtype[np.float64]]: ...
2619
+ @overload # ~complex (`list` ensures invariance to avoid overlap with the previous overload)
2620
+ def mean(
2621
+ a: _NestedSequence[list[complex]] | list[complex],
2622
+ axis: None = None,
2623
+ dtype: None = None,
2624
+ out: None = None,
2625
+ keepdims: Literal[False] | _NoValueType = ...,
2626
+ *,
2627
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2628
+ ) -> np.complex128: ...
2629
+ @overload # ~inexact | timedelta64
2630
+ def mean[ScalarT: np.inexact | np.timedelta64](
2631
+ a: _ArrayLike[ScalarT],
2632
+ axis: None = None,
2633
+ dtype: None = None,
2634
+ out: None = None,
2635
+ keepdims: Literal[False] | _NoValueType = ...,
2636
+ *,
2637
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2638
+ ) -> ScalarT: ...
2639
+ @overload # ~inexact | timedelta64 | object_, axis: <given>
2640
+ def mean[ScalarT: np.inexact | np.timedelta64 | np.object_](
2641
+ a: _ArrayLike[ScalarT],
2642
+ axis: int | tuple[int, ...],
2643
+ dtype: None = None,
2644
+ out: None = None,
2645
+ keepdims: Literal[False] | _NoValueType = ...,
2646
+ *,
2647
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2648
+ ) -> NDArray[ScalarT]: ...
2649
+ @overload # ~inexact | timedelta64 | object_, keepdims=True
2650
+ def mean[ArrayT: NDArray[np.inexact | np.timedelta64 | np.object_]](
2651
+ a: ArrayT,
2652
+ axis: int | tuple[int, ...] | None = None,
2653
+ dtype: None = None,
2654
+ out: None = None,
2655
+ *,
2656
+ keepdims: Literal[True],
2657
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2658
+ ) -> ArrayT: ...
2659
+ @overload # dtype: ScalarT
2660
+ def mean[ScalarT: np.generic](
2661
+ a: _ArrayLikeNumeric_co,
2662
+ axis: None = None,
2663
+ *,
2664
+ dtype: _DTypeLike[ScalarT],
2665
+ out: None = None,
2666
+ keepdims: Literal[False] | _NoValueType = ...,
2667
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2668
+ ) -> ScalarT: ...
2669
+ @overload # dtype: ScalarT (keyword), keepdims=True
2670
+ def mean[ShapeT: _Shape, ScalarT: np.generic](
2671
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
2672
+ axis: int | tuple[int, ...] | None = None,
2673
+ *,
2674
+ dtype: _DTypeLike[ScalarT],
2675
+ out: None = None,
2676
+ keepdims: Literal[True],
2677
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2678
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2679
+ @overload # dtype: ScalarT (positional), keepdims=True
2680
+ def mean[ShapeT: _Shape, ScalarT: np.generic](
2681
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
2682
+ axis: int | tuple[int, ...] | None,
2683
+ dtype: _DTypeLike[ScalarT],
2684
+ out: None = None,
2685
+ *,
2686
+ keepdims: Literal[True],
2687
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2688
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2689
+ @overload # dtype: ScalarT (keyword), keepdims=True
2690
+ def mean[ScalarT: np.generic](
2691
+ a: _ArrayLikeNumeric_co,
2692
+ axis: int | tuple[int, ...] | None = None,
2693
+ *,
2694
+ dtype: _DTypeLike[ScalarT],
2695
+ out: None = None,
2696
+ keepdims: Literal[True],
2697
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2698
+ ) -> NDArray[ScalarT]: ...
2699
+ @overload # axis: <given>, dtype: ScalarT
2700
+ def mean[ScalarT: np.generic](
2701
+ a: _ArrayLikeNumeric_co,
2702
+ axis: int | tuple[int, ...],
2703
+ dtype: _DTypeLike[ScalarT],
2704
+ out: None = None,
2705
+ keepdims: Literal[False] | _NoValueType = ...,
2706
+ *,
2707
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2708
+ ) -> NDArray[ScalarT]: ...
2709
+ @overload # out: ArrayT
2710
+ def mean[ArrayT: np.ndarray](
2711
+ a: _ArrayLikeNumeric_co,
2712
+ axis: int | tuple[int, ...] | None = None,
2713
+ dtype: DTypeLike | None = None,
2714
+ *,
2715
+ out: ArrayT,
2716
+ keepdims: bool | _NoValueType = ...,
2717
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2718
+ ) -> ArrayT: ...
2719
+ @overload # fallback
2720
+ def mean(
2721
+ a: _ArrayLikeNumeric_co,
2722
+ axis: None = None,
2723
+ dtype: DTypeLike | None = None,
2724
+ out: None = None,
2725
+ keepdims: Literal[False] | _NoValueType = ...,
2726
+ *,
2727
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2728
+ ) -> Any: ...
2729
+ @overload # fallback, axis: <given>
2730
+ def mean(
2731
+ a: _ArrayLikeNumeric_co,
2732
+ axis: int | tuple[int, ...],
2733
+ dtype: DTypeLike | None = None,
2734
+ out: None = None,
2735
+ keepdims: Literal[False] | _NoValueType = ...,
2736
+ *,
2737
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2738
+ ) -> NDArray[Any]: ...
2739
+ @overload # fallback, keepdims=True
2740
+ def mean(
2741
+ a: _ArrayLikeNumeric_co,
2742
+ axis: int | tuple[int, ...] | None = None,
2743
+ dtype: DTypeLike | None = None,
2744
+ out: None = None,
2745
+ *,
2746
+ keepdims: Literal[True],
2747
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2748
+ ) -> NDArray[Any]: ...
2749
+
2750
+ #
2751
+ @overload # ~complex128 | +integer | ~object_ | +builtins.float
2752
+ def std(
2753
+ a: _DualArrayLike[np.dtype[np.complex128 | np.integer | np.bool | np.object_], complex],
2754
+ axis: None = None,
2755
+ dtype: None = None,
2756
+ out: None = None,
2757
+ ddof: float = 0,
2758
+ keepdims: Literal[False] | _NoValueType = ...,
2759
+ *,
2760
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2761
+ mean: _ArrayLikeFloat_co | _NoValueType = ...,
2762
+ correction: float | _NoValueType = ...,
2763
+ ) -> np.float64: ...
2764
+ @overload # ~complex128 | +integer | +builtins.float, axis: <given>
2765
+ def std(
2766
+ a: _DualArrayLike[np.dtype[np.complex128 | np.integer | np.bool], complex],
2767
+ axis: int | tuple[int, ...],
2768
+ dtype: None = None,
2769
+ out: None = None,
2770
+ ddof: float = 0,
2771
+ keepdims: Literal[False] | _NoValueType = ...,
2772
+ *,
2773
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2774
+ mean: _ArrayLikeFloat_co | _NoValueType = ...,
2775
+ correction: float | _NoValueType = ...,
2776
+ ) -> NDArray[np.float64]: ...
2777
+ @overload # +integer, keepdims=True
2778
+ def std[ShapeT: _Shape](
2779
+ a: np.ndarray[ShapeT, np.dtype[np.complex128 | np.integer | np.bool]],
2780
+ axis: int | tuple[int, ...] | None = None,
2781
+ dtype: None = None,
2782
+ out: None = None,
2783
+ ddof: float = 0,
2784
+ *,
2785
+ keepdims: Literal[True],
2786
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2787
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2788
+ correction: float | _NoValueType = ...,
2789
+ ) -> np.ndarray[ShapeT, np.dtype[np.float64]]: ...
2790
+ @overload # ~floating | timedelta64
2791
+ def std[ScalarT: np.floating | np.timedelta64](
2792
+ a: _ArrayLike[ScalarT],
2793
+ axis: None = None,
2794
+ dtype: None = None,
2795
+ out: None = None,
2796
+ ddof: float = 0,
2797
+ keepdims: Literal[False] | _NoValueType = ...,
2798
+ *,
2799
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2800
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2801
+ correction: float | _NoValueType = ...,
2802
+ ) -> ScalarT: ...
2803
+ @overload # ~floating | timedelta64 | object_, axis: <given>
2804
+ def std[ScalarT: np.floating | np.timedelta64 | np.object_](
2805
+ a: _ArrayLike[ScalarT],
2806
+ axis: int | tuple[int, ...],
2807
+ dtype: None = None,
2808
+ out: None = None,
2809
+ ddof: float = 0,
2810
+ keepdims: Literal[False] | _NoValueType = ...,
2811
+ *,
2812
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2813
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2814
+ correction: float | _NoValueType = ...,
2815
+ ) -> NDArray[ScalarT]: ...
2816
+ @overload # ~floating | timedelta64 | object_, keepdims=True
2817
+ def std[ArrayT: NDArray[np.floating | np.timedelta64 | np.object_]](
2818
+ a: ArrayT,
2819
+ axis: int | tuple[int, ...] | None = None,
2820
+ dtype: None = None,
2821
+ out: None = None,
2822
+ *,
2823
+ ddof: float = 0,
2824
+ keepdims: Literal[True],
2825
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2826
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2827
+ correction: float | _NoValueType = ...,
2828
+ ) -> ArrayT: ...
2829
+ @overload # dtype: ScalarT
2830
+ def std[ScalarT: np.generic](
2831
+ a: _ArrayLikeNumeric_co,
2832
+ axis: None = None,
2833
+ *,
2834
+ dtype: _DTypeLike[ScalarT],
2835
+ out: None = None,
2836
+ ddof: float = 0,
2837
+ keepdims: Literal[False] | _NoValueType = ...,
2838
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2839
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2840
+ correction: float | _NoValueType = ...,
2841
+ ) -> ScalarT: ...
2842
+ @overload # dtype: ScalarT (keyword), keepdims=True
2843
+ def std[ShapeT: _Shape, ScalarT: np.generic](
2844
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
2845
+ axis: int | tuple[int, ...] | None = None,
2846
+ *,
2847
+ dtype: _DTypeLike[ScalarT],
2848
+ out: None = None,
2849
+ ddof: float = 0,
2850
+ keepdims: Literal[True],
2851
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2852
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2853
+ correction: float | _NoValueType = ...,
2854
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2855
+ @overload # dtype: ScalarT (positional), keepdims=True
2856
+ def std[ShapeT: _Shape, ScalarT: np.generic](
2857
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
2858
+ axis: int | tuple[int, ...] | None,
2859
+ dtype: _DTypeLike[ScalarT],
2860
+ out: None = None,
2861
+ ddof: float = 0,
2862
+ *,
2863
+ keepdims: Literal[True],
2864
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2865
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2866
+ correction: float | _NoValueType = ...,
2867
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
2868
+ @overload # dtype: ScalarT (keyword), keepdims=True
2869
+ def std[ScalarT: np.generic](
2870
+ a: _ArrayLikeNumeric_co,
2871
+ axis: int | tuple[int, ...] | None = None,
2872
+ *,
2873
+ dtype: _DTypeLike[ScalarT],
2874
+ out: None = None,
2875
+ ddof: float = 0,
2876
+ keepdims: Literal[True],
2877
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2878
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2879
+ correction: float | _NoValueType = ...,
2880
+ ) -> NDArray[ScalarT]: ...
2881
+ @overload # axis: <given>, dtype: ScalarT
2882
+ def std[ScalarT: np.generic](
2883
+ a: _ArrayLikeNumeric_co,
2884
+ axis: int | tuple[int, ...],
2885
+ dtype: _DTypeLike[ScalarT],
2886
+ out: None = None,
2887
+ ddof: float = 0,
2888
+ keepdims: Literal[False] | _NoValueType = ...,
2889
+ *,
2890
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2891
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2892
+ correction: float | _NoValueType = ...,
2893
+ ) -> NDArray[ScalarT]: ...
2894
+ @overload # out: ArrayT
2895
+ def std[ArrayT: np.ndarray](
2896
+ a: _ArrayLikeNumeric_co,
2897
+ axis: int | tuple[int, ...] | None = None,
2898
+ dtype: DTypeLike | None = None,
2899
+ *,
2900
+ out: ArrayT,
2901
+ ddof: float = 0,
2902
+ keepdims: bool | _NoValueType = ...,
2903
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2904
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2905
+ correction: float | _NoValueType = ...,
2906
+ ) -> ArrayT: ...
2907
+ @overload # fallback
2908
+ def std(
2909
+ a: _ArrayLikeNumeric_co,
2910
+ axis: None = None,
2911
+ dtype: DTypeLike | None = None,
2912
+ out: None = None,
2913
+ ddof: float = 0,
2914
+ keepdims: Literal[False] | _NoValueType = ...,
2915
+ *,
2916
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2917
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2918
+ correction: float | _NoValueType = ...,
2919
+ ) -> Any: ...
2920
+ @overload # fallback, axis: <given>
2921
+ def std(
2922
+ a: _ArrayLikeNumeric_co,
2923
+ axis: int | tuple[int, ...],
2924
+ dtype: DTypeLike | None = None,
2925
+ out: None = None,
2926
+ ddof: float = 0,
2927
+ keepdims: Literal[False] | _NoValueType = ...,
2928
+ *,
2929
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2930
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2931
+ correction: float | _NoValueType = ...,
2932
+ ) -> NDArray[Any]: ...
2933
+ @overload # fallback, keepdims=True
2934
+ def std(
2935
+ a: _ArrayLikeNumeric_co,
2936
+ axis: int | tuple[int, ...] | None = None,
2937
+ dtype: DTypeLike | None = None,
2938
+ out: None = None,
2939
+ ddof: float = 0,
2940
+ *,
2941
+ keepdims: Literal[True],
2942
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2943
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2944
+ correction: float | _NoValueType = ...,
2945
+ ) -> NDArray[Any]: ...
2946
+
2947
+ # keep in sync with `std` above
2948
+ @overload # ~complex128 | +integer | ~object_ | +builtins.float
2949
+ def var(
2950
+ a: _DualArrayLike[np.dtype[np.complex128 | np.integer | np.bool | np.object_], complex],
2951
+ axis: None = None,
2952
+ dtype: None = None,
2953
+ out: None = None,
2954
+ ddof: float = 0,
2955
+ keepdims: Literal[False] | _NoValueType = ...,
2956
+ *,
2957
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2958
+ mean: _ArrayLikeFloat_co | _NoValueType = ...,
2959
+ correction: float | _NoValueType = ...,
2960
+ ) -> np.float64: ...
2961
+ @overload # ~complex128 | +integer | +builtins.float, axis: <given>
2962
+ def var(
2963
+ a: _DualArrayLike[np.dtype[np.complex128 | np.integer | np.bool], complex],
2964
+ axis: int | tuple[int, ...],
2965
+ dtype: None = None,
2966
+ out: None = None,
2967
+ ddof: float = 0,
2968
+ keepdims: Literal[False] | _NoValueType = ...,
2969
+ *,
2970
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2971
+ mean: _ArrayLikeFloat_co | _NoValueType = ...,
2972
+ correction: float | _NoValueType = ...,
2973
+ ) -> NDArray[np.float64]: ...
2974
+ @overload # +integer, keepdims=True
2975
+ def var[ShapeT: _Shape](
2976
+ a: np.ndarray[ShapeT, np.dtype[np.complex128 | np.integer | np.bool]],
2977
+ axis: int | tuple[int, ...] | None = None,
2978
+ dtype: None = None,
2979
+ out: None = None,
2980
+ ddof: float = 0,
2981
+ *,
2982
+ keepdims: Literal[True],
2983
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2984
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2985
+ correction: float | _NoValueType = ...,
2986
+ ) -> np.ndarray[ShapeT, np.dtype[np.float64]]: ...
2987
+ @overload # ~floating | timedelta64
2988
+ def var[ScalarT: np.floating | np.timedelta64](
2989
+ a: _ArrayLike[ScalarT],
2990
+ axis: None = None,
2991
+ dtype: None = None,
2992
+ out: None = None,
2993
+ ddof: float = 0,
2994
+ keepdims: Literal[False] | _NoValueType = ...,
2995
+ *,
2996
+ where: _ArrayLikeBool_co | _NoValueType = ...,
2997
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
2998
+ correction: float | _NoValueType = ...,
2999
+ ) -> ScalarT: ...
3000
+ @overload # ~floating | timedelta64 | object_, axis: <given>
3001
+ def var[ScalarT: np.floating | np.timedelta64 | np.object_](
3002
+ a: _ArrayLike[ScalarT],
3003
+ axis: int | tuple[int, ...],
3004
+ dtype: None = None,
3005
+ out: None = None,
3006
+ ddof: float = 0,
3007
+ keepdims: Literal[False] | _NoValueType = ...,
3008
+ *,
3009
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3010
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3011
+ correction: float | _NoValueType = ...,
3012
+ ) -> NDArray[ScalarT]: ...
3013
+ @overload # ~floating | timedelta64 | object_, keepdims=True
3014
+ def var[ArrayT: NDArray[np.floating | np.timedelta64 | np.object_]](
3015
+ a: ArrayT,
3016
+ axis: int | tuple[int, ...] | None = None,
3017
+ dtype: None = None,
3018
+ out: None = None,
3019
+ *,
3020
+ ddof: float = 0,
3021
+ keepdims: Literal[True],
3022
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3023
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3024
+ correction: float | _NoValueType = ...,
3025
+ ) -> ArrayT: ...
3026
+ @overload # dtype: ScalarT
3027
+ def var[ScalarT: np.generic](
3028
+ a: _ArrayLikeNumeric_co,
3029
+ axis: None = None,
3030
+ *,
3031
+ dtype: _DTypeLike[ScalarT],
3032
+ out: None = None,
3033
+ ddof: float = 0,
3034
+ keepdims: Literal[False] | _NoValueType = ...,
3035
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3036
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3037
+ correction: float | _NoValueType = ...,
3038
+ ) -> ScalarT: ...
3039
+ @overload # dtype: ScalarT (keyword), keepdims=True
3040
+ def var[ShapeT: _Shape, ScalarT: np.generic](
3041
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
3042
+ axis: int | tuple[int, ...] | None = None,
3043
+ *,
3044
+ dtype: _DTypeLike[ScalarT],
3045
+ out: None = None,
3046
+ ddof: float = 0,
3047
+ keepdims: Literal[True],
3048
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3049
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3050
+ correction: float | _NoValueType = ...,
3051
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
3052
+ @overload # dtype: ScalarT (positional), keepdims=True
3053
+ def var[ShapeT: _Shape, ScalarT: np.generic](
3054
+ a: np.ndarray[ShapeT, np.dtype[np.number | np.bool | np.timedelta64 | np.object_]],
3055
+ axis: int | tuple[int, ...] | None,
3056
+ dtype: _DTypeLike[ScalarT],
3057
+ out: None = None,
3058
+ ddof: float = 0,
3059
+ *,
3060
+ keepdims: Literal[True],
3061
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3062
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3063
+ correction: float | _NoValueType = ...,
3064
+ ) -> np.ndarray[ShapeT, np.dtype[ScalarT]]: ...
3065
+ @overload # dtype: ScalarT (keyword), keepdims=True
3066
+ def var[ScalarT: np.generic](
3067
+ a: _ArrayLikeNumeric_co,
3068
+ axis: int | tuple[int, ...] | None = None,
3069
+ *,
3070
+ dtype: _DTypeLike[ScalarT],
3071
+ out: None = None,
3072
+ ddof: float = 0,
3073
+ keepdims: Literal[True],
3074
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3075
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3076
+ correction: float | _NoValueType = ...,
3077
+ ) -> NDArray[ScalarT]: ...
3078
+ @overload # axis: <given>, dtype: ScalarT
3079
+ def var[ScalarT: np.generic](
3080
+ a: _ArrayLikeNumeric_co,
3081
+ axis: int | tuple[int, ...],
3082
+ dtype: _DTypeLike[ScalarT],
3083
+ out: None = None,
3084
+ ddof: float = 0,
3085
+ keepdims: Literal[False] | _NoValueType = ...,
3086
+ *,
3087
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3088
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3089
+ correction: float | _NoValueType = ...,
3090
+ ) -> NDArray[ScalarT]: ...
3091
+ @overload # out: ArrayT
3092
+ def var[ArrayT: np.ndarray](
3093
+ a: _ArrayLikeNumeric_co,
3094
+ axis: int | tuple[int, ...] | None = None,
3095
+ dtype: DTypeLike | None = None,
3096
+ *,
3097
+ out: ArrayT,
3098
+ ddof: float = 0,
3099
+ keepdims: bool | _NoValueType = ...,
3100
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3101
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3102
+ correction: float | _NoValueType = ...,
3103
+ ) -> ArrayT: ...
3104
+ @overload # fallback
3105
+ def var(
3106
+ a: _ArrayLikeNumeric_co,
3107
+ axis: None = None,
3108
+ dtype: DTypeLike | None = None,
3109
+ out: None = None,
3110
+ ddof: float = 0,
3111
+ keepdims: Literal[False] | _NoValueType = ...,
3112
+ *,
3113
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3114
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3115
+ correction: float | _NoValueType = ...,
3116
+ ) -> Any: ...
3117
+ @overload # fallback, axis: <given>
3118
+ def var(
3119
+ a: _ArrayLikeNumeric_co,
3120
+ axis: int | tuple[int, ...],
3121
+ dtype: DTypeLike | None = None,
3122
+ out: None = None,
3123
+ ddof: float = 0,
3124
+ keepdims: Literal[False] | _NoValueType = ...,
3125
+ *,
3126
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3127
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3128
+ correction: float | _NoValueType = ...,
3129
+ ) -> NDArray[Any]: ...
3130
+ @overload # fallback, keepdims=True
3131
+ def var(
3132
+ a: _ArrayLikeNumeric_co,
3133
+ axis: int | tuple[int, ...] | None = None,
3134
+ dtype: DTypeLike | None = None,
3135
+ out: None = None,
3136
+ ddof: float = 0,
3137
+ *,
3138
+ keepdims: Literal[True],
3139
+ where: _ArrayLikeBool_co | _NoValueType = ...,
3140
+ mean: _ArrayLikeComplex_co | _NoValueType = ...,
3141
+ correction: float | _NoValueType = ...,
3142
+ ) -> NDArray[Any]: ...
3143
+
3144
+ round = around