summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-04-29 19:13:20 -0600
committerGitHub <noreply@github.com>2021-04-29 19:13:20 -0600
commite424d3e54541b34529345a41a36b00c68769ace1 (patch)
treeb84bed392e9e7d737d581f00044aac63dc2ac54e /numpy
parenteb8656d6cb58b3a64c26e9ee50f950eccc9b7d09 (diff)
parent7d6d74a3ac913ea306d5b237112d3f034b996232 (diff)
downloadnumpy-e424d3e54541b34529345a41a36b00c68769ace1.tar.gz
Merge pull request #18853 from BvB93/placeholder_main2
ENH: Improve the placeholder annotations within sub-modules (part 2)
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi400
-rw-r--r--numpy/core/__init__.pyi2
-rw-r--r--numpy/lib/__init__.pyi350
-rw-r--r--numpy/lib/_version.pyi19
-rw-r--r--numpy/lib/arraypad.pyi5
-rw-r--r--numpy/lib/arraysetops.pyi12
-rw-r--r--numpy/lib/format.pyi28
-rw-r--r--numpy/lib/function_base.pyi57
-rw-r--r--numpy/lib/histograms.pyi7
-rw-r--r--numpy/lib/mixins.pyi62
-rw-r--r--numpy/lib/nanfunctions.pyi54
-rw-r--r--numpy/lib/npyio.pyi104
-rw-r--r--numpy/lib/polynomial.pyi19
-rw-r--r--numpy/lib/scimath.pyi (renamed from numpy/emath.pyi)0
-rw-r--r--numpy/lib/shape_base.pyi24
-rw-r--r--numpy/lib/stride_tricks.pyi16
-rw-r--r--numpy/lib/twodim_base.pyi32
-rw-r--r--numpy/lib/type_check.pyi19
-rw-r--r--numpy/lib/utils.pyi19
-rw-r--r--numpy/linalg/__init__.pyi43
-rw-r--r--numpy/typing/tests/test_isfile.py1
21 files changed, 938 insertions, 335 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index 6899343c0..5c7a3c7e4 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -184,7 +184,6 @@ else:
from numpy import (
char as char,
ctypeslib as ctypeslib,
- emath as emath,
fft as fft,
lib as lib,
linalg as linalg,
@@ -343,6 +342,73 @@ from numpy.core.shape_base import (
vstack as vstack,
)
+from numpy.lib import (
+ emath as emath,
+)
+
+from numpy.lib.arraypad import (
+ pad as pad,
+)
+
+from numpy.lib.arraysetops import (
+ ediff1d as ediff1d,
+ intersect1d as intersect1d,
+ setxor1d as setxor1d,
+ union1d as union1d,
+ setdiff1d as setdiff1d,
+ unique as unique,
+ in1d as in1d,
+ isin as isin,
+)
+
+from numpy.lib.arrayterator import (
+ Arrayterator as Arrayterator,
+)
+
+from numpy.lib.function_base import (
+ select as select,
+ piecewise as piecewise,
+ trim_zeros as trim_zeros,
+ copy as copy,
+ iterable as iterable,
+ percentile as percentile,
+ diff as diff,
+ gradient as gradient,
+ angle as angle,
+ unwrap as unwrap,
+ sort_complex as sort_complex,
+ disp as disp,
+ flip as flip,
+ rot90 as rot90,
+ extract as extract,
+ place as place,
+ asarray_chkfinite as asarray_chkfinite,
+ average as average,
+ bincount as bincount,
+ digitize as digitize,
+ cov as cov,
+ corrcoef as corrcoef,
+ msort as msort,
+ median as median,
+ sinc as sinc,
+ hamming as hamming,
+ hanning as hanning,
+ bartlett as bartlett,
+ blackman as blackman,
+ kaiser as kaiser,
+ trapz as trapz,
+ i0 as i0,
+ add_newdoc as add_newdoc,
+ add_docstring as add_docstring,
+ meshgrid as meshgrid,
+ delete as delete,
+ insert as insert,
+ append as append,
+ interp as interp,
+ add_newdoc_ufunc as add_newdoc_ufunc,
+ quantile as quantile,
+)
+
from numpy.lib.index_tricks import (
ravel_multi_index as ravel_multi_index,
unravel_index as unravel_index,
@@ -358,12 +424,131 @@ from numpy.lib.index_tricks import (
diag_indices_from as diag_indices_from,
)
+from numpy.lib.nanfunctions import (
+ nansum as nansum,
+ nanmax as nanmax,
+ nanmin as nanmin,
+ nanargmax as nanargmax,
+ nanargmin as nanargmin,
+ nanmean as nanmean,
+ nanmedian as nanmedian,
+ nanpercentile as nanpercentile,
+ nanvar as nanvar,
+ nanstd as nanstd,
+ nanprod as nanprod,
+ nancumsum as nancumsum,
+ nancumprod as nancumprod,
+ nanquantile as nanquantile,
+)
+
+from numpy.lib.npyio import (
+ savetxt as savetxt,
+ loadtxt as loadtxt,
+ genfromtxt as genfromtxt,
+ recfromtxt as recfromtxt,
+ recfromcsv as recfromcsv,
+ load as load,
+ loads as loads,
+ save as save,
+ savez as savez,
+ savez_compressed as savez_compressed,
+ packbits as packbits,
+ unpackbits as unpackbits,
+ fromregex as fromregex,
+)
+
+from numpy.lib.polynomial import (
+ poly as poly,
+ roots as roots,
+ polyint as polyint,
+ polyder as polyder,
+ polyadd as polyadd,
+ polysub as polysub,
+ polymul as polymul,
+ polydiv as polydiv,
+ polyval as polyval,
+ polyfit as polyfit,
+)
+
+from numpy.lib.shape_base import (
+ column_stack as column_stack,
+ row_stack as row_stack,
+ dstack as dstack,
+ array_split as array_split,
+ split as split,
+ hsplit as hsplit,
+ vsplit as vsplit,
+ dsplit as dsplit,
+ apply_over_axes as apply_over_axes,
+ expand_dims as expand_dims,
+ apply_along_axis as apply_along_axis,
+ kron as kron,
+ tile as tile,
+ get_array_wrap as get_array_wrap,
+ take_along_axis as take_along_axis,
+ put_along_axis as put_along_axis,
+)
+
+from numpy.lib.stride_tricks import (
+ broadcast_to as broadcast_to,
+ broadcast_arrays as broadcast_arrays,
+ broadcast_shapes as broadcast_shapes,
+)
+
+from numpy.lib.twodim_base import (
+ diag as diag,
+ diagflat as diagflat,
+ eye as eye,
+ fliplr as fliplr,
+ flipud as flipud,
+ tri as tri,
+ triu as triu,
+ tril as tril,
+ vander as vander,
+ histogram2d as histogram2d,
+ mask_indices as mask_indices,
+ tril_indices as tril_indices,
+ tril_indices_from as tril_indices_from,
+ triu_indices as triu_indices,
+ triu_indices_from as triu_indices_from,
+)
+
+from numpy.lib.type_check import (
+ mintypecode as mintypecode,
+ asfarray as asfarray,
+ real as real,
+ imag as imag,
+ iscomplex as iscomplex,
+ isreal as isreal,
+ iscomplexobj as iscomplexobj,
+ isrealobj as isrealobj,
+ nan_to_num as nan_to_num,
+ real_if_close as real_if_close,
+ typename as typename,
+ common_type as common_type,
+)
+
from numpy.lib.ufunclike import (
fix as fix,
isposinf as isposinf,
isneginf as isneginf,
)
+from numpy.lib.utils import (
+ issubclass_ as issubclass_,
+ issubsctype as issubsctype,
+ issubdtype as issubdtype,
+ deprecate as deprecate,
+ deprecate_with_doc as deprecate_with_doc,
+ get_include as get_include,
+ info as info,
+ source as source,
+ who as who,
+ lookfor as lookfor,
+ byte_bounds as byte_bounds,
+ safe_eval as safe_eval,
+)
+
__all__: List[str]
__path__: List[str]
__version__: str
@@ -376,7 +561,10 @@ __git_version__: str
# TODO: Remove `__getattr__` once the classes are stubbed out
class DataSource:
def __init__(self, destpath: Any = ...) -> None: ...
- def __getattr__(self, key: str) -> Any: ...
+ def __del__(self): ...
+ def abspath(self, path): ...
+ def exists(self, path): ...
+ def open(self, path, mode=..., encoding=..., newline=...): ...
class MachAr:
def __init__(
@@ -550,7 +738,55 @@ class poly1d:
variable: Any = ...,
) -> None: ...
def __call__(self, val: Any) -> Any: ...
- def __getattr__(self, key: str) -> Any: ...
+ __hash__: Any
+ @property
+ def coeffs(self): ...
+ @coeffs.setter
+ def coeffs(self, value): ...
+ @property
+ def c(self): ...
+ @c.setter
+ def c(self, value): ...
+ @property
+ def coef(self): ...
+ @coef.setter
+ def coef(self, value): ...
+ @property
+ def coefficients(self): ...
+ @coefficients.setter
+ def coefficients(self, value): ...
+ @property
+ def variable(self): ...
+ @property
+ def order(self): ...
+ @property
+ def o(self): ...
+ @property
+ def roots(self): ...
+ @property
+ def r(self): ...
+ def __array__(self, t=...): ...
+ def __len__(self): ...
+ def __neg__(self): ...
+ def __pos__(self): ...
+ def __mul__(self, other): ...
+ def __rmul__(self, other): ...
+ def __add__(self, other): ...
+ def __radd__(self, other): ...
+ def __pow__(self, val): ...
+ def __sub__(self, other): ...
+ def __rsub__(self, other): ...
+ def __div__(self, other): ...
+ def __truediv__(self, other): ...
+ def __rdiv__(self, other): ...
+ def __rtruediv__(self, other): ...
+ def __eq__(self, other): ...
+ def __ne__(self, other): ...
+ def __getitem__(self, val): ...
+ def __setitem__(self, key, val): ...
+ def __iter__(self): ...
+ def integ(self, m=..., k=...): ...
+ def deriv(self, m=...): ...
class recarray(ndarray[_ShapeType, _DType_co]):
def __new__(
@@ -580,6 +816,12 @@ class record(void):
def pprint(self): ...
class vectorize:
+ pyfunc: Any
+ cache: Any
+ signature: Any
+ otypes: Any
+ excluded: Any
+ __doc__: Any
def __init__(
self,
pyfunc,
@@ -590,157 +832,21 @@ class vectorize:
signature: Any = ...,
) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
- def __getattr__(self, key: str) -> Any: ...
# Placeholders for Python-based functions
-def angle(z, deg=...): ...
-def append(arr, values, axis=...): ...
-def apply_along_axis(func1d, axis, arr, *args, **kwargs): ...
-def apply_over_axes(func, a, axes): ...
-def array_split(ary, indices_or_sections, axis=...): ...
-def asarray_chkfinite(a, dtype=..., order=...): ...
-def asfarray(a, dtype=...): ...
def asmatrix(data, dtype=...): ...
def asscalar(a): ...
-def average(a, axis=..., weights=..., returned=...): ...
-def bartlett(M): ...
-def blackman(M): ...
-def bmat(obj, ldict=..., gdict=...): ...
-def broadcast_arrays(*args, subok=...): ...
-def broadcast_to(array, shape, subok=...): ...
-def byte_bounds(a): ...
-def column_stack(tup): ...
-def common_type(*arrays): ...
-def copy(a, order=..., subok=...): ...
-def corrcoef(x, y=..., rowvar=..., bias=..., ddof=..., *, dtype=...): ...
-def cov(m, y=..., rowvar=..., bias=..., ddof=..., fweights=..., aweights=..., *, dtype=...): ...
def cumproduct(*args, **kwargs): ...
-def delete(arr, obj, axis=...): ...
-def deprecate(*args, **kwargs): ...
-def deprecate_with_doc(msg): ...
-def diag(v, k=...): ...
-def diagflat(v, k=...): ...
-def diff(a, n=..., axis=..., prepend=..., append=...): ...
-def digitize(x, bins, right=...): ...
-def disp(mesg, device=..., linefeed=...): ...
-def dsplit(ary, indices_or_sections): ...
-def dstack(tup): ...
-def ediff1d(ary, to_end=..., to_begin=...): ...
-def expand_dims(a, axis): ...
-def extract(condition, arr): ...
-def flip(m, axis=...): ...
-def fliplr(m): ...
-def flipud(m): ...
-def fromregex(file, regexp, dtype, encoding=...): ...
-def genfromtxt(fname, dtype=..., comments=..., delimiter=..., skip_header=..., skip_footer=..., converters=..., missing_values=..., filling_values=..., usecols=..., names=..., excludelist=..., deletechars=..., replace_space=..., autostrip=..., case_sensitive=..., defaultfmt=..., unpack=..., usemask=..., loose=..., invalid_raise=..., max_rows=..., encoding=..., *, like=...): ...
-def get_include(): ...
-def gradient(f, *varargs, axis=..., edge_order=...): ...
-def hamming(M): ...
-def hanning(M): ...
def histogram(a, bins=..., range=..., normed=..., weights=..., density=...): ...
-def histogram2d(x, y, bins=..., range=..., normed=..., weights=..., density=...): ...
def histogram_bin_edges(a, bins=..., range=..., weights=...): ...
def histogramdd(sample, bins=..., range=..., normed=..., weights=..., density=...): ...
-def hsplit(ary, indices_or_sections): ...
-def i0(x): ...
-def imag(val): ...
-def in1d(ar1, ar2, assume_unique=..., invert=...): ...
-def info(object=..., maxwidth=..., output=..., toplevel=...): ...
-def insert(arr, obj, values, axis=...): ...
-def interp(x, xp, fp, left=..., right=..., period=...): ...
-def intersect1d(ar1, ar2, assume_unique=..., return_indices=...): ...
-def iscomplex(x): ...
-def iscomplexobj(x): ...
-def isin(element, test_elements, assume_unique=..., invert=...): ...
-def isreal(x): ...
-def isrealobj(x): ...
-def iterable(y): ...
-def kaiser(M, beta): ...
-def kron(a, b): ...
-def load(file, mmap_mode=..., allow_pickle=..., fix_imports=..., encoding=...): ...
-def loads(*args, **kwargs): ...
-def loadtxt(fname, dtype=..., comments=..., delimiter=..., converters=..., skiprows=..., usecols=..., unpack=..., ndmin=..., encoding=..., max_rows=..., *, like=...): ...
-def lookfor(what, module=..., import_modules=..., regenerate=..., output=...): ...
-def mafromtxt(fname, **kwargs): ...
-def mask_indices(n, mask_func, k=...): ...
def mat(data, dtype=...): ...
def max(a, axis=..., out=..., keepdims=..., initial=..., where=...): ...
-def median(a, axis=..., out=..., overwrite_input=..., keepdims=...): ...
-def meshgrid(*xi, copy=..., sparse=..., indexing=...): ...
def min(a, axis=..., out=..., keepdims=..., initial=..., where=...): ...
-def mintypecode(typechars, typeset=..., default=...): ...
-def msort(a): ...
-def nan_to_num(x, copy=..., nan=..., posinf=..., neginf=...): ...
-def nanargmax(a, axis=...): ...
-def nanargmin(a, axis=...): ...
-def nancumprod(a, axis=..., dtype=..., out=...): ...
-def nancumsum(a, axis=..., dtype=..., out=...): ...
-def nanmax(a, axis=..., out=..., keepdims=...): ...
-def nanmean(a, axis=..., dtype=..., out=..., keepdims=...): ...
-def nanmedian(a, axis=..., out=..., overwrite_input=..., keepdims=...): ...
-def nanmin(a, axis=..., out=..., keepdims=...): ...
-def nanpercentile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
-def nanprod(a, axis=..., dtype=..., out=..., keepdims=...): ...
-def nanquantile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
-def nanstd(a, axis=..., dtype=..., out=..., ddof=..., keepdims=...): ...
-def nansum(a, axis=..., dtype=..., out=..., keepdims=...): ...
-def nanvar(a, axis=..., dtype=..., out=..., ddof=..., keepdims=...): ...
-def ndfromtxt(fname, **kwargs): ...
-def pad(array, pad_width, mode=..., **kwargs): ...
-def percentile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
-def piecewise(x, condlist, funclist, *args, **kw): ...
-def place(arr, mask, vals): ...
-def poly(seq_of_zeros): ...
-def polyadd(a1, a2): ...
-def polyder(p, m=...): ...
-def polydiv(u, v): ...
-def polyfit(x, y, deg, rcond=..., full=..., w=..., cov=...): ...
-def polyint(p, m=..., k=...): ...
-def polymul(a1, a2): ...
-def polysub(a1, a2): ...
-def polyval(p, x): ...
def product(*args, **kwargs): ...
-def put_along_axis(arr, indices, values, axis): ...
-def quantile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
-def real(val): ...
-def real_if_close(a, tol=...): ...
-def recfromcsv(fname, **kwargs): ...
-def recfromtxt(fname, **kwargs): ...
-def roots(p): ...
-def rot90(m, k=..., axes=...): ...
def round(a, decimals=..., out=...): ...
def round_(a, decimals=..., out=...): ...
-def row_stack(tup): ...
-def save(file, arr, allow_pickle=..., fix_imports=...): ...
-def savetxt(fname, X, fmt=..., delimiter=..., newline=..., header=..., footer=..., comments=..., encoding=...): ...
-def savez(file, *args, **kwds): ...
-def savez_compressed(file, *args, **kwds): ...
-def select(condlist, choicelist, default=...): ...
-def setdiff1d(ar1, ar2, assume_unique=...): ...
-def setxor1d(ar1, ar2, assume_unique=...): ...
def show_config(): ...
-def sinc(x): ...
-def sort_complex(a): ...
-def source(object, output=...): ...
-def split(ary, indices_or_sections, axis=...): ...
-def take_along_axis(arr, indices, axis): ...
-def tile(A, reps): ...
-def trapz(y, x=..., dx=..., axis=...): ...
-def tri(N, M=..., k=..., dtype=..., *, like=...): ...
-def tril(m, k=...): ...
-def tril_indices(n, k=..., m=...): ...
-def tril_indices_from(arr, k=...): ...
-def trim_zeros(filt, trim=...): ...
-def triu(m, k=...): ...
-def triu_indices(n, k=..., m=...): ...
-def triu_indices_from(arr, k=...): ...
-def typename(char): ...
-def union1d(ar1, ar2): ...
-def unique(ar, return_index=..., return_inverse=..., return_counts=..., axis=...): ...
-def unwrap(p, discont=..., axis=...): ...
-def vander(x, N=..., increasing=...): ...
-def vsplit(ary, indices_or_sections): ...
-def who(vardict=...): ...
# Placeholders for C-based functions
# TODO: Sort out which parameters are positional-only
@@ -748,7 +854,6 @@ def who(vardict=...): ...
def arange(stop, dtype=..., *, like=...): ...
@overload
def arange(start, stop, step=..., dtype=..., *, like=...): ...
-def bincount(x, weights=..., minlength=...): ...
def busday_count(
begindates,
enddates,
@@ -789,13 +894,11 @@ def lexsort(keys, axis=...): ...
def may_share_memory(a, b, max_work=...): ...
def min_scalar_type(a): ...
def nested_iters(*args, **kwargs): ... # TODO: Sort out parameters
-def packbits(a, axis=..., bitorder=...): ...
def promote_types(type1, type2): ...
def putmask(a, mask, values): ...
def result_type(*arrays_and_dtypes): ...
def seterrobj(errobj): ...
def shares_memory(a, b, max_work=...): ...
-def unpackbits(a, axis=..., count=..., bitorder=...): ...
def vdot(a, b): ...
@overload
def where(__condition): ...
@@ -806,17 +909,6 @@ _NdArraySubClass = TypeVar("_NdArraySubClass", bound=ndarray)
_DTypeScalar_co = TypeVar("_DTypeScalar_co", covariant=True, bound=generic)
_ByteOrder = Literal["S", "<", ">", "=", "|", "L", "B", "N", "I"]
-# TODO: Move to `np.lib.twodim_base`
-def eye(
- N: int,
- M: Optional[int] = ...,
- k: int = ...,
- dtype: DTypeLike = ...,
- order: _OrderCF = ...,
- *,
- like: Optional[ArrayLike] = ...
-) -> ndarray[Any, Any]: ...
-
class dtype(Generic[_DTypeScalar_co]):
names: Optional[Tuple[str, ...]]
# Overload for subclass of generic
@@ -3106,8 +3198,6 @@ def empty(
like: ArrayLike = ...,
) -> ndarray: ...
-def broadcast_shapes(*args: _ShapeLike) -> _Shape: ...
-
#
# Constants
#
diff --git a/numpy/core/__init__.pyi b/numpy/core/__init__.pyi
index e69de29bb..4c7a42bf3 100644
--- a/numpy/core/__init__.pyi
+++ b/numpy/core/__init__.pyi
@@ -0,0 +1,2 @@
+# NOTE: The `np.core` namespace is deliberately kept empty due to it
+# being private (despite the lack of leading underscore)
diff --git a/numpy/lib/__init__.pyi b/numpy/lib/__init__.pyi
index 02ed56c8b..2904b6a84 100644
--- a/numpy/lib/__init__.pyi
+++ b/numpy/lib/__init__.pyi
@@ -1,3 +1,4 @@
+import math as math
from typing import Any, List
from numpy import (
@@ -5,6 +6,8 @@ from numpy import (
ndindex as ndindex,
)
+from numpy.version import version
+
from numpy.lib import (
format as format,
mixins as mixins,
@@ -12,10 +15,74 @@ from numpy.lib import (
stride_tricks as stride_stricks,
)
+from numpy.lib._version import (
+ NumpyVersion as NumpyVersion,
+)
+
+from numpy.lib.arraypad import (
+ pad as pad,
+)
+
+from numpy.lib.arraysetops import (
+ ediff1d as ediff1d,
+ intersect1d as intersect1d,
+ setxor1d as setxor1d,
+ union1d as union1d,
+ setdiff1d as setdiff1d,
+ unique as unique,
+ in1d as in1d,
+ isin as isin,
+)
+
from numpy.lib.arrayterator import (
Arrayterator as Arrayterator,
)
+from numpy.lib.function_base import (
+ select as select,
+ piecewise as piecewise,
+ trim_zeros as trim_zeros,
+ copy as copy,
+ iterable as iterable,
+ percentile as percentile,
+ diff as diff,
+ gradient as gradient,
+ angle as angle,
+ unwrap as unwrap,
+ sort_complex as sort_complex,
+ disp as disp,
+ flip as flip,
+ rot90 as rot90,
+ extract as extract,
+ place as place,
+ vectorize as vectorize,
+ asarray_chkfinite as asarray_chkfinite,
+ average as average,
+ bincount as bincount,
+ digitize as digitize,
+ cov as cov,
+ corrcoef as corrcoef,
+ msort as msort,
+ median as median,
+ sinc as sinc,
+ hamming as hamming,
+ hanning as hanning,
+ bartlett as bartlett,
+ blackman as blackman,
+ kaiser as kaiser,
+ trapz as trapz,
+ i0 as i0,
+ add_newdoc as add_newdoc,
+ add_docstring as add_docstring,
+ meshgrid as meshgrid,
+ delete as delete,
+ insert as insert,
+ append as append,
+ interp as interp,
+ add_newdoc_ufunc as add_newdoc_ufunc,
+ quantile as quantile,
+)
+
from numpy.lib.index_tricks import (
ravel_multi_index as ravel_multi_index,
unravel_index as unravel_index,
@@ -31,169 +98,136 @@ from numpy.lib.index_tricks import (
diag_indices_from as diag_indices_from,
)
+from numpy.lib.nanfunctions import (
+ nansum as nansum,
+ nanmax as nanmax,
+ nanmin as nanmin,
+ nanargmax as nanargmax,
+ nanargmin as nanargmin,
+ nanmean as nanmean,
+ nanmedian as nanmedian,
+ nanpercentile as nanpercentile,
+ nanvar as nanvar,
+ nanstd as nanstd,
+ nanprod as nanprod,
+ nancumsum as nancumsum,
+ nancumprod as nancumprod,
+ nanquantile as nanquantile,
+)
+
+from numpy.lib.npyio import (
+ savetxt as savetxt,
+ loadtxt as loadtxt,
+ genfromtxt as genfromtxt,
+ recfromtxt as recfromtxt,
+ recfromcsv as recfromcsv,
+ load as load,
+ loads as loads,
+ save as save,
+ savez as savez,
+ savez_compressed as savez_compressed,
+ packbits as packbits,
+ unpackbits as unpackbits,
+ fromregex as fromregex,
+ DataSource as DataSource,
+)
+
+from numpy.lib.polynomial import (
+ poly as poly,
+ roots as roots,
+ polyint as polyint,
+ polyder as polyder,
+ polyadd as polyadd,
+ polysub as polysub,
+ polymul as polymul,
+ polydiv as polydiv,
+ polyval as polyval,
+ polyfit as polyfit,
+ RankWarning as RankWarning,
+ poly1d as poly1d,
+)
+
+from numpy.lib.shape_base import (
+ column_stack as column_stack,
+ row_stack as row_stack,
+ dstack as dstack,
+ array_split as array_split,
+ split as split,
+ hsplit as hsplit,
+ vsplit as vsplit,
+ dsplit as dsplit,
+ apply_over_axes as apply_over_axes,
+ expand_dims as expand_dims,
+ apply_along_axis as apply_along_axis,
+ kron as kron,
+ tile as tile,
+ get_array_wrap as get_array_wrap,
+ take_along_axis as take_along_axis,
+ put_along_axis as put_along_axis,
+)
+
+from numpy.lib.stride_tricks import (
+ broadcast_to as broadcast_to,
+ broadcast_arrays as broadcast_arrays,
+ broadcast_shapes as broadcast_shapes,
+)
+
+from numpy.lib.twodim_base import (
+ diag as diag,
+ diagflat as diagflat,
+ eye as eye,
+ fliplr as fliplr,
+ flipud as flipud,
+ tri as tri,
+ triu as triu,
+ tril as tril,
+ vander as vander,
+ histogram2d as histogram2d,
+ mask_indices as mask_indices,
+ tril_indices as tril_indices,
+ tril_indices_from as tril_indices_from,
+ triu_indices as triu_indices,
+ triu_indices_from as triu_indices_from,
+)
+
+from numpy.lib.type_check import (
+ mintypecode as mintypecode,
+ asfarray as asfarray,
+ real as real,
+ imag as imag,
+ iscomplex as iscomplex,
+ isreal as isreal,
+ iscomplexobj as iscomplexobj,
+ isrealobj as isrealobj,
+ nan_to_num as nan_to_num,
+ real_if_close as real_if_close,
+ typename as typename,
+ common_type as common_type,
+)
+
from numpy.lib.ufunclike import (
fix as fix,
isposinf as isposinf,
isneginf as isneginf,
)
+from numpy.lib.utils import (
+ issubclass_ as issubclass_,
+ issubsctype as issubsctype,
+ issubdtype as issubdtype,
+ deprecate as deprecate,
+ deprecate_with_doc as deprecate_with_doc,
+ get_include as get_include,
+ info as info,
+ source as source,
+ who as who,
+ lookfor as lookfor,
+ byte_bounds as byte_bounds,
+ safe_eval as safe_eval,
+)
+
__all__: List[str]
-emath: Any
-math: Any
-tracemalloc_domain: Any
-iscomplexobj: Any
-isrealobj: Any
-imag: Any
-iscomplex: Any
-isreal: Any
-nan_to_num: Any
-real: Any
-real_if_close: Any
-typename: Any
-asfarray: Any
-mintypecode: Any
-asscalar: Any
-common_type: Any
-select: Any
-piecewise: Any
-trim_zeros: Any
-copy: Any
-iterable: Any
-percentile: Any
-diff: Any
-gradient: Any
-angle: Any
-unwrap: Any
-sort_complex: Any
-disp: Any
-flip: Any
-rot90: Any
-extract: Any
-place: Any
-vectorize: Any
-asarray_chkfinite: Any
-average: Any
-bincount: Any
-digitize: Any
-cov: Any
-corrcoef: Any
-msort: Any
-median: Any
-sinc: Any
-hamming: Any
-hanning: Any
-bartlett: Any
-blackman: Any
-kaiser: Any
-trapz: Any
-i0: Any
-add_newdoc: Any
-add_docstring: Any
-meshgrid: Any
-delete: Any
-insert: Any
-append: Any
-interp: Any
-add_newdoc_ufunc: Any
-quantile: Any
-column_stack: Any
-row_stack: Any
-dstack: Any
-array_split: Any
-split: Any
-hsplit: Any
-vsplit: Any
-dsplit: Any
-apply_over_axes: Any
-expand_dims: Any
-apply_along_axis: Any
-kron: Any
-tile: Any
-get_array_wrap: Any
-take_along_axis: Any
-put_along_axis: Any
-broadcast_to: Any
-broadcast_arrays: Any
-diag: Any
-diagflat: Any
-eye: Any
-fliplr: Any
-flipud: Any
-tri: Any
-triu: Any
-tril: Any
-vander: Any
-histogram2d: Any
-mask_indices: Any
-tril_indices: Any
-tril_indices_from: Any
-triu_indices: Any
-triu_indices_from: Any
-pad: Any
-poly: Any
-roots: Any
-polyint: Any
-polyder: Any
-polyadd: Any
-polysub: Any
-polymul: Any
-polydiv: Any
-polyval: Any
-poly1d: Any
-polyfit: Any
-RankWarning: Any
-issubclass_: Any
-issubsctype: Any
-issubdtype: Any
-deprecate: Any
-deprecate_with_doc: Any
-get_include: Any
-info: Any
-source: Any
-who: Any
-lookfor: Any
-byte_bounds: Any
-safe_eval: Any
-ediff1d: Any
-intersect1d: Any
-setxor1d: Any
-union1d: Any
-setdiff1d: Any
-unique: Any
-in1d: Any
-isin: Any
-savetxt: Any
-loadtxt: Any
-genfromtxt: Any
-ndfromtxt: Any
-mafromtxt: Any
-recfromtxt: Any
-recfromcsv: Any
-load: Any
-loads: Any
-save: Any
-savez: Any
-savez_compressed: Any
-packbits: Any
-unpackbits: Any
-fromregex: Any
-DataSource: Any
-nansum: Any
-nanmax: Any
-nanmin: Any
-nanargmax: Any
-nanargmin: Any
-nanmean: Any
-nanmedian: Any
-nanpercentile: Any
-nanvar: Any
-nanstd: Any
-nanprod: Any
-nancumsum: Any
-nancumprod: Any
-nanquantile: Any
-histogram: Any
-histogramdd: Any
-histogram_bin_edges: Any
-NumpyVersion: Any
+__version__ = version
+emath = scimath
+tracemalloc_domain: int
diff --git a/numpy/lib/_version.pyi b/numpy/lib/_version.pyi
new file mode 100644
index 000000000..20b049757
--- /dev/null
+++ b/numpy/lib/_version.pyi
@@ -0,0 +1,19 @@
+from typing import Any, List
+
+__all__: List[str]
+
+class NumpyVersion:
+ vstring: Any
+ version: Any
+ major: Any
+ minor: Any
+ bugfix: Any
+ pre_release: Any
+ is_devversion: Any
+ def __init__(self, vstring): ...
+ def __lt__(self, other): ...
+ def __le__(self, other): ...
+ def __eq__(self, other): ...
+ def __ne__(self, other): ...
+ def __gt__(self, other): ...
+ def __ge__(self, other): ...
diff --git a/numpy/lib/arraypad.pyi b/numpy/lib/arraypad.pyi
new file mode 100644
index 000000000..64e3e1331
--- /dev/null
+++ b/numpy/lib/arraypad.pyi
@@ -0,0 +1,5 @@
+from typing import List
+
+__all__: List[str]
+
+def pad(array, pad_width, mode=..., **kwargs): ...
diff --git a/numpy/lib/arraysetops.pyi b/numpy/lib/arraysetops.pyi
new file mode 100644
index 000000000..029aa1474
--- /dev/null
+++ b/numpy/lib/arraysetops.pyi
@@ -0,0 +1,12 @@
+from typing import List
+
+__all__: List[str]
+
+def ediff1d(ary, to_end=..., to_begin=...): ...
+def unique(ar, return_index=..., return_inverse=..., return_counts=..., axis=...): ...
+def intersect1d(ar1, ar2, assume_unique=..., return_indices=...): ...
+def setxor1d(ar1, ar2, assume_unique=...): ...
+def in1d(ar1, ar2, assume_unique=..., invert=...): ...
+def isin(element, test_elements, assume_unique=..., invert=...): ...
+def union1d(ar1, ar2): ...
+def setdiff1d(ar1, ar2, assume_unique=...): ...
diff --git a/numpy/lib/format.pyi b/numpy/lib/format.pyi
new file mode 100644
index 000000000..4c44d57bf
--- /dev/null
+++ b/numpy/lib/format.pyi
@@ -0,0 +1,28 @@
+import sys
+from typing import Any, List, Set
+
+if sys.version_info >= (3, 8):
+ from typing import Literal, Final
+else:
+ from typing_extensions import Literal, Final
+
+__all__: List[str]
+
+EXPECTED_KEYS: Final[Set[str]]
+MAGIC_PREFIX: Final[bytes]
+MAGIC_LEN: Literal[8]
+ARRAY_ALIGN: Literal[64]
+BUFFER_SIZE: Literal[262144] # 2**18
+
+def magic(major, minor): ...
+def read_magic(fp): ...
+def dtype_to_descr(dtype): ...
+def descr_to_dtype(descr): ...
+def header_data_from_array_1_0(array): ...
+def write_array_header_1_0(fp, d): ...
+def write_array_header_2_0(fp, d): ...
+def read_array_header_1_0(fp): ...
+def read_array_header_2_0(fp): ...
+def write_array(fp, array, version=..., allow_pickle=..., pickle_kwargs=...): ...
+def read_array(fp, allow_pickle=..., pickle_kwargs=...): ...
+def open_memmap(filename, mode=..., dtype=..., shape=..., fortran_order=..., version=...): ...
diff --git a/numpy/lib/function_base.pyi b/numpy/lib/function_base.pyi
new file mode 100644
index 000000000..da24ab21d
--- /dev/null
+++ b/numpy/lib/function_base.pyi
@@ -0,0 +1,57 @@
+from typing import List
+
+from numpy import (
+ vectorize as vectorize,
+)
+
+from numpy.core.function_base import (
+ add_newdoc as add_newdoc,
+)
+
+from numpy.core.multiarray import (
+ add_docstring as add_docstring,
+ bincount as bincount,
+)
+from numpy.core.umath import _add_newdoc_ufunc
+
+__all__: List[str]
+
+add_newdoc_ufunc = _add_newdoc_ufunc
+
+def rot90(m, k=..., axes = ...): ...
+def flip(m, axis=...): ...
+def iterable(y): ...
+def average(a, axis=..., weights=..., returned=...): ...
+def asarray_chkfinite(a, dtype=..., order=...): ...
+def piecewise(x, condlist, funclist, *args, **kw): ...
+def select(condlist, choicelist, default=...): ...
+def copy(a, order=..., subok=...): ...
+def gradient(f, *varargs, axis=..., edge_order=...): ...
+def diff(a, n=..., axis=..., prepend = ..., append = ...): ...
+def interp(x, xp, fp, left=..., right=..., period=...): ...
+def angle(z, deg=...): ...
+def unwrap(p, discont = ..., axis=...): ...
+def sort_complex(a): ...
+def trim_zeros(filt, trim=...): ...
+def extract(condition, arr): ...
+def place(arr, mask, vals): ...
+def disp(mesg, device=..., linefeed=...): ...
+def cov(m, y=..., rowvar=..., bias=..., ddof=..., fweights=..., aweights=..., *, dtype=...): ...
+def corrcoef(x, y=..., rowvar=..., bias = ..., ddof = ..., *, dtype=...): ...
+def blackman(M): ...
+def bartlett(M): ...
+def hanning(M): ...
+def hamming(M): ...
+def i0(x): ...
+def kaiser(M, beta): ...
+def sinc(x): ...
+def msort(a): ...
+def median(a, axis=..., out=..., overwrite_input=..., keepdims=...): ...
+def percentile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
+def quantile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
+def trapz(y, x=..., dx=..., axis=...): ...
+def meshgrid(*xi, copy=..., sparse=..., indexing=...): ...
+def delete(arr, obj, axis=...): ...
+def insert(arr, obj, values, axis=...): ...
+def append(arr, values, axis=...): ...
+def digitize(x, bins, right=...): ...
diff --git a/numpy/lib/histograms.pyi b/numpy/lib/histograms.pyi
new file mode 100644
index 000000000..25a33e3ae
--- /dev/null
+++ b/numpy/lib/histograms.pyi
@@ -0,0 +1,7 @@
+from typing import List
+
+__all__: List[str]
+
+def histogram_bin_edges(a, bins=..., range=..., weights=...): ...
+def histogram(a, bins=..., range=..., normed=..., weights=..., density=...): ...
+def histogramdd(sample, bins=..., range=..., normed=..., weights=..., density=...): ...
diff --git a/numpy/lib/mixins.pyi b/numpy/lib/mixins.pyi
new file mode 100644
index 000000000..f137bb5bc
--- /dev/null
+++ b/numpy/lib/mixins.pyi
@@ -0,0 +1,62 @@
+from typing import List
+from abc import ABCMeta, abstractmethod
+
+__all__: List[str]
+
+# NOTE: `NDArrayOperatorsMixin` is not formally an abstract baseclass,
+# even though it's reliant on subclasses implementing `__array_ufunc__`
+
+class NDArrayOperatorsMixin(metaclass=ABCMeta):
+ @abstractmethod
+ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
+ def __lt__(self, other): ...
+ def __le__(self, other): ...
+ def __eq__(self, other): ...
+ def __ne__(self, other): ...
+ def __gt__(self, other): ...
+ def __ge__(self, other): ...
+ def __add__(self, other): ...
+ def __radd__(self, other): ...
+ def __iadd__(self, other): ...
+ def __sub__(self, other): ...
+ def __rsub__(self, other): ...
+ def __isub__(self, other): ...
+ def __mul__(self, other): ...
+ def __rmul__(self, other): ...
+ def __imul__(self, other): ...
+ def __matmul__(self, other): ...
+ def __rmatmul__(self, other): ...
+ def __imatmul__(self, other): ...
+ def __truediv__(self, other): ...
+ def __rtruediv__(self, other): ...
+ def __itruediv__(self, other): ...
+ def __floordiv__(self, other): ...
+ def __rfloordiv__(self, other): ...
+ def __ifloordiv__(self, other): ...
+ def __mod__(self, other): ...
+ def __rmod__(self, other): ...
+ def __imod__(self, other): ...
+ def __divmod__(self, other): ...
+ def __rdivmod__(self, other): ...
+ def __pow__(self, other): ...
+ def __rpow__(self, other): ...
+ def __ipow__(self, other): ...
+ def __lshift__(self, other): ...
+ def __rlshift__(self, other): ...
+ def __ilshift__(self, other): ...
+ def __rshift__(self, other): ...
+ def __rrshift__(self, other): ...
+ def __irshift__(self, other): ...
+ def __and__(self, other): ...
+ def __rand__(self, other): ...
+ def __iand__(self, other): ...
+ def __xor__(self, other): ...
+ def __rxor__(self, other): ...
+ def __ixor__(self, other): ...
+ def __or__(self, other): ...
+ def __ror__(self, other): ...
+ def __ior__(self, other): ...
+ def __neg__(self): ...
+ def __pos__(self): ...
+ def __abs__(self): ...
+ def __invert__(self): ...
diff --git a/numpy/lib/nanfunctions.pyi b/numpy/lib/nanfunctions.pyi
new file mode 100644
index 000000000..447770a54
--- /dev/null
+++ b/numpy/lib/nanfunctions.pyi
@@ -0,0 +1,54 @@
+from typing import List
+
+__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=...,
+): ...
diff --git a/numpy/lib/npyio.pyi b/numpy/lib/npyio.pyi
new file mode 100644
index 000000000..508357927
--- /dev/null
+++ b/numpy/lib/npyio.pyi
@@ -0,0 +1,104 @@
+from typing import Mapping, List, Any
+
+from numpy import (
+ DataSource as DataSource,
+)
+
+from numpy.core.multiarray import (
+ packbits as packbits,
+ unpackbits as unpackbits,
+)
+
+__all__: List[str]
+
+def loads(*args, **kwargs): ...
+
+class BagObj:
+ def __init__(self, obj): ...
+ def __getattribute__(self, key): ...
+ def __dir__(self): ...
+
+def zipfile_factory(file, *args, **kwargs): ...
+
+class NpzFile(Mapping[Any, Any]):
+ zip: Any
+ fid: Any
+ files: Any
+ allow_pickle: Any
+ pickle_kwargs: Any
+ f: Any
+ def __init__(self, fid, own_fid=..., allow_pickle=..., pickle_kwargs=...): ...
+ def __enter__(self): ...
+ def __exit__(self, exc_type, exc_value, traceback): ...
+ def close(self): ...
+ def __del__(self): ...
+ def __iter__(self): ...
+ def __len__(self): ...
+ def __getitem__(self, key): ...
+ def iteritems(self): ...
+ def iterkeys(self): ...
+
+def load(file, mmap_mode=..., allow_pickle=..., fix_imports=..., encoding=...): ...
+def save(file, arr, allow_pickle=..., fix_imports=...): ...
+def savez(file, *args, **kwds): ...
+def savez_compressed(file, *args, **kwds): ...
+def loadtxt(
+ fname,
+ dtype=...,
+ comments=...,
+ delimiter=...,
+ converters=...,
+ skiprows=...,
+ usecols=...,
+ unpack=...,
+ ndmin=...,
+ encoding=...,
+ max_rows=...,
+ *,
+ like=...,
+): ...
+def savetxt(
+ fname,
+ X,
+ fmt=...,
+ delimiter=...,
+ newline=...,
+ header=...,
+ footer=...,
+ comments=...,
+ encoding=...,
+): ...
+def fromregex(file, regexp, dtype, encoding=...): ...
+def genfromtxt(
+ fname,
+ dtype=...,
+ comments=...,
+ delimiter=...,
+ skip_header=...,
+ skip_footer=...,
+ converters=...,
+ missing_values=...,
+ filling_values=...,
+ usecols=...,
+ names=...,
+ excludelist=...,
+ deletechars=...,
+ replace_space=...,
+ autostrip=...,
+ case_sensitive=...,
+ defaultfmt=...,
+ unpack=...,
+ usemask=...,
+ loose=...,
+ invalid_raise=...,
+ max_rows=...,
+ encoding=...,
+ *,
+ like=...,
+): ...
+def recfromtxt(fname, **kwargs): ...
+def recfromcsv(fname, **kwargs): ...
+
+# NOTE: Deprecated
+# def ndfromtxt(fname, **kwargs): ...
+# def mafromtxt(fname, **kwargs): ...
diff --git a/numpy/lib/polynomial.pyi b/numpy/lib/polynomial.pyi
new file mode 100644
index 000000000..7d38658d0
--- /dev/null
+++ b/numpy/lib/polynomial.pyi
@@ -0,0 +1,19 @@
+from typing import List
+
+from numpy import (
+ RankWarning as RankWarning,
+ poly1d as poly1d,
+)
+
+__all__: List[str]
+
+def poly(seq_of_zeros): ...
+def roots(p): ...
+def polyint(p, m=..., k=...): ...
+def polyder(p, m=...): ...
+def polyfit(x, y, deg, rcond=..., full=..., w=..., cov=...): ...
+def polyval(p, x): ...
+def polyadd(a1, a2): ...
+def polysub(a1, a2): ...
+def polymul(a1, a2): ...
+def polydiv(u, v): ...
diff --git a/numpy/emath.pyi b/numpy/lib/scimath.pyi
index d0d4af41e..d0d4af41e 100644
--- a/numpy/emath.pyi
+++ b/numpy/lib/scimath.pyi
diff --git a/numpy/lib/shape_base.pyi b/numpy/lib/shape_base.pyi
new file mode 100644
index 000000000..09edbcb6c
--- /dev/null
+++ b/numpy/lib/shape_base.pyi
@@ -0,0 +1,24 @@
+from typing import List
+
+from numpy.core.shape_base import vstack
+
+__all__: List[str]
+
+row_stack = vstack
+
+def take_along_axis(arr, indices, axis): ...
+def put_along_axis(arr, indices, values, axis): ...
+def apply_along_axis(func1d, axis, arr, *args, **kwargs): ...
+def apply_over_axes(func, a, axes): ...
+def expand_dims(a, axis): ...
+def column_stack(tup): ...
+def dstack(tup): ...
+def array_split(ary, indices_or_sections, axis=...): ...
+def split(ary, indices_or_sections, axis=...): ...
+def hsplit(ary, indices_or_sections): ...
+def vsplit(ary, indices_or_sections): ...
+def dsplit(ary, indices_or_sections): ...
+def get_array_prepare(*args): ...
+def get_array_wrap(*args): ...
+def kron(a, b): ...
+def tile(A, reps): ...
diff --git a/numpy/lib/stride_tricks.pyi b/numpy/lib/stride_tricks.pyi
new file mode 100644
index 000000000..d2e744b5a
--- /dev/null
+++ b/numpy/lib/stride_tricks.pyi
@@ -0,0 +1,16 @@
+from typing import Any, List
+
+from numpy.typing import _ShapeLike, _Shape
+
+__all__: List[str]
+
+class DummyArray:
+ __array_interface__: Any
+ base: Any
+ def __init__(self, interface, base=...): ...
+
+def as_strided(x, shape=..., strides=..., subok=..., writeable=...): ...
+def sliding_window_view(x, window_shape, axis=..., *, subok=..., writeable=...): ...
+def broadcast_to(array, shape, subok=...): ...
+def broadcast_shapes(*args: _ShapeLike) -> _Shape: ...
+def broadcast_arrays(*args, subok=...): ...
diff --git a/numpy/lib/twodim_base.pyi b/numpy/lib/twodim_base.pyi
new file mode 100644
index 000000000..79b9511b8
--- /dev/null
+++ b/numpy/lib/twodim_base.pyi
@@ -0,0 +1,32 @@
+from typing import List, Optional, Any
+
+from numpy import ndarray, _OrderCF
+from numpy.typing import ArrayLike, DTypeLike
+
+__all__: List[str]
+
+def fliplr(m): ...
+def flipud(m): ...
+
+def eye(
+ N: int,
+ M: Optional[int] = ...,
+ k: int = ...,
+ dtype: DTypeLike = ...,
+ order: _OrderCF = ...,
+ *,
+ like: Optional[ArrayLike] = ...
+) -> ndarray[Any, Any]: ...
+
+def diag(v, k=...): ...
+def diagflat(v, k=...): ...
+def tri(N, M=..., k=..., dtype = ..., *, like=...): ...
+def tril(m, k=...): ...
+def triu(m, k=...): ...
+def vander(x, N=..., increasing=...): ...
+def histogram2d(x, y, bins=..., range=..., normed=..., weights=..., density=...): ...
+def mask_indices(n, mask_func, k=...): ...
+def tril_indices(n, k=..., m=...): ...
+def tril_indices_from(arr, k=...): ...
+def triu_indices(n, k=..., m=...): ...
+def triu_indices_from(arr, k=...): ...
diff --git a/numpy/lib/type_check.pyi b/numpy/lib/type_check.pyi
new file mode 100644
index 000000000..7da02bb9f
--- /dev/null
+++ b/numpy/lib/type_check.pyi
@@ -0,0 +1,19 @@
+from typing import List
+
+__all__: List[str]
+
+def mintypecode(typechars, typeset=..., default=...): ...
+def asfarray(a, dtype = ...): ...
+def real(val): ...
+def imag(val): ...
+def iscomplex(x): ...
+def isreal(x): ...
+def iscomplexobj(x): ...
+def isrealobj(x): ...
+def nan_to_num(x, copy=..., nan=..., posinf=..., neginf=...): ...
+def real_if_close(a, tol=...): ...
+def typename(char): ...
+def common_type(*arrays): ...
+
+# NOTE: Deprecated
+# def asscalar(a): ...
diff --git a/numpy/lib/utils.pyi b/numpy/lib/utils.pyi
new file mode 100644
index 000000000..5a1594149
--- /dev/null
+++ b/numpy/lib/utils.pyi
@@ -0,0 +1,19 @@
+from typing import List
+
+from numpy.core.numerictypes import (
+ issubclass_ as issubclass_,
+ issubdtype as issubdtype,
+ issubsctype as issubsctype,
+)
+
+__all__: List[str]
+
+def get_include(): ...
+def deprecate(*args, **kwargs): ...
+def deprecate_with_doc(msg): ...
+def byte_bounds(a): ...
+def who(vardict=...): ...
+def info(object=..., maxwidth=..., output=..., toplevel=...): ...
+def source(object, output=...): ...
+def lookfor(what, module=..., import_modules=..., regenerate=..., output=...): ...
+def safe_eval(source): ...
diff --git a/numpy/linalg/__init__.pyi b/numpy/linalg/__init__.pyi
index 39b061969..5080019f4 100644
--- a/numpy/linalg/__init__.pyi
+++ b/numpy/linalg/__init__.pyi
@@ -2,24 +2,25 @@ from typing import Any, List
__all__: List[str]
-matrix_power: Any
-solve: Any
-tensorsolve: Any
-tensorinv: Any
-inv: Any
-cholesky: Any
-eigvals: Any
-eigvalsh: Any
-pinv: Any
-slogdet: Any
-det: Any
-svd: Any
-eig: Any
-eigh: Any
-lstsq: Any
-norm: Any
-qr: Any
-cond: Any
-matrix_rank: Any
-LinAlgError: Any
-multi_dot: Any
+class LinAlgError(Exception): ...
+
+def tensorsolve(a, b, axes=...): ...
+def solve(a, b): ...
+def tensorinv(a, ind=...): ...
+def inv(a): ...
+def matrix_power(a, n): ...
+def cholesky(a): ...
+def qr(a, mode=...): ...
+def eigvals(a): ...
+def eigvalsh(a, UPLO=...): ...
+def eig(a): ...
+def eigh(a, UPLO=...): ...
+def svd(a, full_matrices=..., compute_uv=..., hermitian=...): ...
+def cond(x, p=...): ...
+def matrix_rank(M, tol=..., hermitian=...): ...
+def pinv(a, rcond=..., hermitian=...): ...
+def slogdet(a): ...
+def det(a): ...
+def lstsq(a, b, rcond=...): ...
+def norm(x, ord=..., axis=..., keepdims=...): ...
+def multi_dot(arrays, *, out=...): ...
diff --git a/numpy/typing/tests/test_isfile.py b/numpy/typing/tests/test_isfile.py
index 569f05435..b617b3873 100644
--- a/numpy/typing/tests/test_isfile.py
+++ b/numpy/typing/tests/test_isfile.py
@@ -10,7 +10,6 @@ FILES = [
ROOT / "__init__.pyi",
ROOT / "char.pyi",
ROOT / "ctypeslib.pyi",
- ROOT / "emath.pyi",
ROOT / "rec.pyi",
ROOT / "core" / "__init__.pyi",
ROOT / "distutils" / "__init__.pyi",