diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-10-04 17:02:36 +0200 |
---|---|---|
committer | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-10-04 19:04:23 +0200 |
commit | 418e18a3474ac5bb94f2f6d898f58484b8834b5d (patch) | |
tree | becc06c98d87e489c5a573b0de1f3c2a10a38000 /numpy/lib/nanfunctions.pyi | |
parent | 0b1825d17b48a761f7efd13b08e327455027f7c3 (diff) | |
download | numpy-418e18a3474ac5bb94f2f6d898f58484b8834b5d.tar.gz |
ENH: Update (and simplify) the `nan<x>` function annotations
Diffstat (limited to 'numpy/lib/nanfunctions.pyi')
-rw-r--r-- | numpy/lib/nanfunctions.pyi | 86 |
1 files changed, 36 insertions, 50 deletions
diff --git a/numpy/lib/nanfunctions.pyi b/numpy/lib/nanfunctions.pyi index 447770a54..54b4a7e26 100644 --- a/numpy/lib/nanfunctions.pyi +++ b/numpy/lib/nanfunctions.pyi @@ -1,54 +1,40 @@ from typing import List +from numpy.core.fromnumeric import ( + amin, + amax, + argmin, + argmax, + sum, + prod, + cumsum, + cumprod, + mean, + var, + std +) + +from numpy.lib.function_base import ( + median, + percentile, + quantile, +) + __all__: List[str] -def nanmin(a, axis=..., out=..., keepdims=...): ... -def nanmax(a, axis=..., out=..., keepdims=...): ... -def nanargmin(a, axis=...): ... -def nanargmax(a, axis=...): ... -def nansum(a, axis=..., dtype=..., out=..., keepdims=...): ... -def nanprod(a, axis=..., dtype=..., out=..., keepdims=...): ... -def nancumsum(a, axis=..., dtype=..., out=...): ... -def nancumprod(a, axis=..., dtype=..., out=...): ... -def nanmean(a, axis=..., dtype=..., out=..., keepdims=...): ... -def nanmedian( - a, - axis=..., - out=..., - overwrite_input=..., - keepdims=..., -): ... -def nanpercentile( - a, - q, - axis=..., - out=..., - overwrite_input=..., - interpolation=..., - keepdims=..., -): ... -def nanquantile( - a, - q, - axis=..., - out=..., - overwrite_input=..., - interpolation=..., - keepdims=..., -): ... -def nanvar( - a, - axis=..., - dtype=..., - out=..., - ddof=..., - keepdims=..., -): ... -def nanstd( - a, - axis=..., - dtype=..., - out=..., - ddof=..., - keepdims=..., -): ... +# NOTE: In reaility these functions are not aliases but distinct functions +# with identical signatures. +nanmin = amin +nanmax = amax +nanargmin = argmin +nanargmax = argmax +nansum = sum +nanprod = prod +nancumsum = cumsum +nancumprod = cumprod +nanmean = mean +nanvar = var +nanstd = std +nanmedian = median +nanpercentile = percentile +nanquantile = quantile |