summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib')
-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.pyi13
-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
17 files changed, 682 insertions, 158 deletions
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/lib/scimath.pyi b/numpy/lib/scimath.pyi
new file mode 100644
index 000000000..d0d4af41e
--- /dev/null
+++ b/numpy/lib/scimath.pyi
@@ -0,0 +1,13 @@
+from typing import List
+
+__all__: List[str]
+
+def sqrt(x): ...
+def log(x): ...
+def log10(x): ...
+def logn(n, x): ...
+def log2(x): ...
+def power(x, p): ...
+def arccos(x): ...
+def arcsin(x): ...
+def arctanh(x): ...
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): ...