id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
169,809 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def polyvander(x, deg):
"""Vandermonde matrix of given degree.
Returns the Vandermonde matrix of degree `deg` and sample points
`x`. The Vander... | Least-squares fit of a polynomial to data. Return the coefficients of a polynomial of degree `deg` that is the least squares fit to the data values `y` given at points `x`. If `y` is 1-D the returned coefficients will also be 1-D. If `y` is 2-D multiple fits are done, one for each column of `y`, and the resulting coeff... |
169,810 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def polycompanion(c):
"""
Return the companion matrix of c.
The companion matrix for power series cannot be made symmetric by
scaling the b... | Compute the roots of a polynomial. Return the roots (a.k.a. "zeros") of the polynomial .. math:: p(x) = \\sum_i c[i] * x^i. Parameters ---------- c : 1-D array_like 1-D array of polynomial coefficients. Returns ------- out : ndarray Array of the roots of the polynomial. If all the roots are real, then `out` is also rea... |
169,827 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeadd(c1, c2):
"""
Add one Hermite series to another.
Returns the sum of two Hermite series `c1` + `c2`. The arguments
are sequence... | poly2herme(pol) Convert a polynomial to a Hermite series. Convert an array representing the coefficients of a polynomial (relative to the "standard" basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Hermite series, ordered from lowest to highest degree. Parameters ---------... |
169,828 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def polyadd(c1, c2):
"""
Add one polynomial to another.
Returns the sum of two polynomials `c1` + `c2`. The arguments are
sequences of c... | Convert a Hermite series to a polynomial. Convert an array representing the coefficients of a Hermite series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest to highest degree. Parameters ---------- c : array_like... |
169,829 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeline(off, scl):
"""
Hermite series whose graph is a straight line.
Parameters
----------
off, scl : scalars
The specif... | Generate a HermiteE series with given roots. The function returns the coefficients of the polynomial .. math:: p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n), in HermiteE form, where the `r_n` are the roots specified in `roots`. If a zero has multiplicity n, then it must appear in `roots` n times. For instance, if 2 is... |
169,830 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermemul(c1, c2):
"""
Multiply one Hermite series by another.
Returns the product of two Hermite series `c1` * `c2`. The arguments
are... | Divide one Hermite series by another. Returns the quotient-with-remainder of two Hermite series `c1` / `c2`. The arguments are sequences of coefficients from lowest order "term" to highest, e.g., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D arrays of Hermite serie... |
169,831 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermemul(c1, c2):
"""
Multiply one Hermite series by another.
Returns the product of two Hermite series `c1` * `c2`. The arguments
are... | Raise a Hermite series to a power. Returns the Hermite series `c` raised to the power `pow`. The argument `c` is a sequence of coefficients ordered from low to high. i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.`` Parameters ---------- c : array_like 1-D array of Hermite series coefficients ordered from low to hig... |
169,832 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
The provided code snippet includes necessary dependencies for implementing the `hermeder` function. Write a Python function `def hermeder(c, m=1, scl=1, a... | Differentiate a Hermite_e series. Returns the series coefficients `c` differentiated `m` times along `axis`. At each iteration the result is multiplied by `scl` (the scaling factor is for use in a linear change of variable). The argument `c` is an array of coefficients from low to high degree along each axis, e.g., [1,... |
169,833 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeval(x, c, tensor=True):
"""
Evaluate an HermiteE series at points x.
If `c` is of length `n + 1`, this function returns the value:
... | Integrate a Hermite_e series. Returns the Hermite_e series coefficients `c` integrated `m` times from `lbnd` along `axis`. At each iteration the resulting series is **multiplied** by `scl` and an integration constant, `k`, is added. The scaling factor is for use in a linear change of variable. ("Buyer beware": note tha... |
169,834 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeval(x, c, tensor=True):
"""
Evaluate an HermiteE series at points x.
If `c` is of length `n + 1`, this function returns the value:
... | Evaluate a 2-D HermiteE series at points (x, y). This function returns the values: .. math:: p(x,y) = \\sum_{i,j} c_{i,j} * He_i(x) * He_j(y) The parameters `x` and `y` are converted to arrays only if they are tuples or a lists, otherwise they are treated as a scalars and they must have the same shape after conversion.... |
169,835 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeval(x, c, tensor=True):
"""
Evaluate an HermiteE series at points x.
If `c` is of length `n + 1`, this function returns the value:
... | Evaluate a 2-D HermiteE series on the Cartesian product of x and y. This function returns the values: .. math:: p(a,b) = \\sum_{i,j} c_{i,j} * H_i(a) * H_j(b) where the points `(a, b)` consist of all pairs formed by taking `a` from `x` and `b` from `y`. The resulting points form a grid with `x` in the first dimension a... |
169,836 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeval(x, c, tensor=True):
"""
Evaluate an HermiteE series at points x.
If `c` is of length `n + 1`, this function returns the value:
... | Evaluate a 3-D Hermite_e series at points (x, y, z). This function returns the values: .. math:: p(x,y,z) = \\sum_{i,j,k} c_{i,j,k} * He_i(x) * He_j(y) * He_k(z) The parameters `x`, `y`, and `z` are converted to arrays only if they are tuples or a lists, otherwise they are treated as a scalars and they must have the sa... |
169,837 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermeval(x, c, tensor=True):
"""
Evaluate an HermiteE series at points x.
If `c` is of length `n + 1`, this function returns the value:
... | Evaluate a 3-D HermiteE series on the Cartesian product of x, y, and z. This function returns the values: .. math:: p(a,b,c) = \\sum_{i,j,k} c_{i,j,k} * He_i(a) * He_j(b) * He_k(c) where the points `(a, b, c)` consist of all triples formed by taking `a` from `x`, `b` from `y`, and `c` from `z`. The resulting points for... |
169,838 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermevander(x, deg):
"""Pseudo-Vandermonde matrix of given degree.
Returns the pseudo-Vandermonde matrix of degree `deg` and sample points
... | Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y)`. The pseudo-Vandermonde matrix is defined by .. math:: V[..., (deg[1] + 1)*i + j] = He_i(x) * He_j(y), where `0 <= i <= deg[0]` and `0 <= j <= deg[1]`. The leading indices of `V` index the point... |
169,839 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermevander(x, deg):
"""Pseudo-Vandermonde matrix of given degree.
Returns the pseudo-Vandermonde matrix of degree `deg` and sample points
... | Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y, z)`. If `l, m, n` are the given degrees in `x, y, z`, then Hehe pseudo-Vandermonde matrix is defined by .. math:: V[..., (m+1)(n+1)i + (n+1)j + k] = He_i(x)*He_j(y)*He_k(z), where `0 <= i <= l`, ... |
169,840 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermevander(x, deg):
"""Pseudo-Vandermonde matrix of given degree.
Returns the pseudo-Vandermonde matrix of degree `deg` and sample points
... | Least squares fit of Hermite series to data. Return the coefficients of a HermiteE series of degree `deg` that is the least squares fit to the data values `y` given at points `x`. If `y` is 1-D the returned coefficients will also be 1-D. If `y` is 2-D multiple fits are done, one for each column of `y`, and the resultin... |
169,841 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermecompanion(c):
"""
Return the scaled companion matrix of c.
The basis polynomials are scaled so that the companion matrix is
symmet... | Compute the roots of a HermiteE series. Return the roots (a.k.a. "zeros") of the polynomial .. math:: p(x) = \\sum_i c[i] * He_i(x). Parameters ---------- c : 1-D array_like 1-D array of coefficients. Returns ------- out : ndarray Array of the roots of the series. If all the roots are real, then `out` is also real, oth... |
169,842 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
def hermecompanion(c):
"""
Return the scaled companion matrix of c.
The basis polynomials are scaled so that the companion matrix is
symmet... | Gauss-HermiteE quadrature. Computes the sample points and weights for Gauss-HermiteE quadrature. These sample points and weights will correctly integrate polynomials of degree :math:`2*deg - 1` or less over the interval :math:`[-\\inf, \\inf]` with the weight function :math:`f(x) = \\exp(-x^2/2)`. Parameters ----------... |
169,843 | import numpy as np
import numpy.linalg as la
from numpy.core.multiarray import normalize_axis_index
from . import polyutils as pu
from ._polybase import ABCPolyBase
The provided code snippet includes necessary dependencies for implementing the `hermeweight` function. Write a Python function `def hermeweight(x)` to sol... | Weight function of the Hermite_e polynomials. The weight function is :math:`\\exp(-x^2/2)` and the interval of integration is :math:`[-\\inf, \\inf]`. the HermiteE polynomials are orthogonal, but not normalized, with respect to this weight function. Parameters ---------- x : array_like Values at which the weight functi... |
169,897 | import operator
import functools
import warnings
import numpy as np
from numpy.core.multiarray import dragon4_positional, dragon4_scientific
from numpy.core.umath import absolute
def as_series(alist, trim=True):
"""
Return argument as a list of 1-d arrays.
The returned list contains array(s) of dtype double... | Remove "small" "trailing" coefficients from a polynomial. "Small" means "small in absolute value" and is controlled by the parameter `tol`; "trailing" means highest order coefficient(s), e.g., in ``[0, 1, 1, 0, 0]`` (which represents ``0 + x + x**2 + 0*x**3 + 0*x**4``) both the 3-rd and 4-th order coefficients would be... |
169,898 | import operator
import functools
import warnings
import numpy as np
from numpy.core.multiarray import dragon4_positional, dragon4_scientific
from numpy.core.umath import absolute
def as_series(alist, trim=True):
"""
Return argument as a list of 1-d arrays.
The returned list contains array(s) of dtype double... | Return a domain suitable for given abscissae. Find a domain suitable for a polynomial or Chebyshev series defined at the values supplied. Parameters ---------- x : array_like 1-d array of abscissae whose domain will be determined. Returns ------- domain : ndarray 1-d array containing two values. If the inputs are compl... |
169,899 | import operator
import functools
import warnings
import numpy as np
from numpy.core.multiarray import dragon4_positional, dragon4_scientific
from numpy.core.umath import absolute
def mapparms(old, new):
"""
Linear map parameters between domains.
Return the parameters of the linear map ``offset + scale*x`` t... | Apply linear map to input points. The linear map ``offset + scale*x`` that maps the domain `old` to the domain `new` is applied to the points `x`. Parameters ---------- x : array_like Points to be mapped. If `x` is a subtype of ndarray the subtype will be preserved. old, new : array_like The two domains that determine ... |
169,900 | import operator
import functools
import warnings
import numpy as np
from numpy.core.multiarray import dragon4_positional, dragon4_scientific
from numpy.core.umath import absolute
def format_float(x, parens=False):
if not np.issubdtype(type(x), np.floating):
return str(x)
opts = np.get_printoptions()
... | null |
169,938 | import os
from numpy import (
integer, ndarray, dtype as _dtype, asarray, frombuffer
)
from numpy.core.multiarray import _flagdict, flagsobj
The provided code snippet includes necessary dependencies for implementing the `_dummy` function. Write a Python function `def _dummy(*args, **kwds)` to solve the following p... | Dummy object that raises an ImportError if ctypes is not available. Raises ------ ImportError If ctypes is not available. |
169,939 | import os
from numpy import (
integer, ndarray, dtype as _dtype, asarray, frombuffer
)
from numpy.core.multiarray import _flagdict, flagsobj
try:
import ctypes
except ImportError:
ctypes = None
if ctypes is None:
load_library = _dummy
as_ctypes = _dummy
as_array = _dummy
from numpy import in... | It is possible to load a library using >>> lib = ctypes.cdll[<full_path_name>] # doctest: +SKIP But there are cross-platform considerations, such as library file extensions, plus the fact Windows will just load the first library it finds with that name. NumPy supplies the load_library function as a convenience. .. vers... |
169,940 | import os
from numpy import (
integer, ndarray, dtype as _dtype, asarray, frombuffer
)
from numpy.core.multiarray import _flagdict, flagsobj
def _num_fromflags(flaglist):
num = 0
for val in flaglist:
num += _flagdict[val]
return num
def _flags_fromnum(num):
res = []
for key in _flagnames... | Array-checking restype/argtypes. An ndpointer instance is used to describe an ndarray in restypes and argtypes specifications. This approach is more flexible than using, for example, ``POINTER(c_double)``, since several restrictions can be specified, which are verified upon calling the ctypes function. These include da... |
169,941 | import os
from numpy import (
integer, ndarray, dtype as _dtype, asarray, frombuffer
)
from numpy.core.multiarray import _flagdict, flagsobj
try:
import ctypes
except ImportError:
ctypes = None
if ctypes is None:
load_library = _dummy
as_ctypes = _dummy
as_array = _dummy
from numpy import in... | Return a dictionary mapping native endian scalar dtype to ctypes types |
169,942 | import os
from numpy import (
integer, ndarray, dtype as _dtype, asarray, frombuffer
)
from numpy.core.multiarray import _flagdict, flagsobj
try:
import ctypes
except ImportError:
ctypes = None
if ctypes is None:
load_library = _dummy
as_ctypes = _dummy
as_array = _dummy
from numpy import in... | Create a numpy array from a ctypes array or POINTER. The numpy array shares the memory with the ctypes object. The shape parameter must be given if converting from a ctypes POINTER. The shape parameter is ignored if converting from a ctypes array |
169,943 | import os
from numpy import (
integer, ndarray, dtype as _dtype, asarray, frombuffer
)
from numpy.core.multiarray import _flagdict, flagsobj
if ctypes is not None:
def _ctype_ndarray(element_type, shape):
""" Create an ndarray of the given element type and shape """
for dim in shape[::-1]:
... | Create and return a ctypes object from a numpy array. Actually anything that exposes the __array_interface__ is accepted. |
169,944 | import os
import sys
from os.path import join
from numpy.distutils.system_info import platform_bits
from numpy.distutils.msvccompiler import lib_opts_if_msvc
import sys
if sys.version_info >= (3, 9):
def randbytes(n: int) -> bytes:
if sys.version_info >= (3, 9):
def sample(population: Union[Sequence[_T]... | null |
169,945 | from .mtrand import RandomState
from ._philox import Philox
from ._pcg64 import PCG64, PCG64DXSM
from ._sfc64 import SFC64
from ._generator import Generator
from ._mt19937 import MT19937
def __bit_generator_ctor(bit_generator_name='MT19937'):
"""
Pickling helper function that returns a bit generator object
... | Pickling helper function that returns a Generator object Parameters ---------- bit_generator_name : str String containing the core BitGenerator's name bit_generator_ctor : callable, optional Callable function that takes bit_generator_name as its only argument and returns an instantized bit generator. Returns ------- rg... |
169,946 | from .mtrand import RandomState
from ._philox import Philox
from ._pcg64 import PCG64, PCG64DXSM
from ._sfc64 import SFC64
from ._generator import Generator
from ._mt19937 import MT19937
def __bit_generator_ctor(bit_generator_name='MT19937'):
"""
Pickling helper function that returns a bit generator object
... | Pickling helper function that returns a legacy RandomState-like object Parameters ---------- bit_generator_name : str String containing the core BitGenerator's name bit_generator_ctor : callable, optional Callable function that takes bit_generator_name as its only argument and returns an instantized bit generator. Retu... |
169,947 | import os
The provided code snippet includes necessary dependencies for implementing the `parse_distributions_h` function. Write a Python function `def parse_distributions_h(ffi, inc_dir)` to solve the following problem:
Parse distributions.h located in inc_dir for CFFI, filling in the ffi.cdef Read the function decla... | Parse distributions.h located in inc_dir for CFFI, filling in the ffi.cdef Read the function declarations without the "#define ..." macros that will be filled in when loading the library. |
169,948 | import numpy as np
import numba as nb
from numpy.random import PCG64
from timeit import timeit
next_d = bit_gen.cffi.next_double
r2 = numpycall()
def normals(n, state):
out = np.empty(n)
for i in range((n + 1) // 2):
x1 = 2.0 * next_d(state) - 1.0
x2 = 2.0 * next_d(state) - 1.0
r2 = x1 ... | null |
169,949 | import numpy as np
import numba as nb
from numpy.random import PCG64
from timeit import timeit
state_addr = bit_gen.cffi.state_address
normalsj = nb.jit(normals, nopython=True)
n = 10000
def numbacall():
return normalsj(n, state_addr) | null |
169,950 | import numpy as np
import numba as nb
from numpy.random import PCG64
from timeit import timeit
n = 10000
rg = np.random.Generator(PCG64())
def numpycall():
return rg.normal(size=n) | null |
169,951 | import numpy as np
import numba as nb
from numpy.random import PCG64
from timeit import timeit
def bounded_uint(lb, ub, state):
mask = delta = ub - lb
mask |= mask >> 1
mask |= mask >> 2
mask |= mask >> 4
mask |= mask >> 8
mask |= mask >> 16
val = next_u32(state) & mask
while val > delta... | null |
169,952 | import os
import numba as nb
import numpy as np
from cffi import FFI
from numpy.random import PCG64
random_standard_normal = lib.random_standard_normal
def normals(n, bit_generator):
out = np.empty(n)
for i in range(n):
out[i] = random_standard_normal(bit_generator)
return out | null |
169,953 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
class matrix(N.ndarray):
"""
matrix(data, dtype=None, copy=True)
.. note:: It is no longer recommended to use this class, even for linear
algebra. Instead use regular arrays. The cla... | Matrix of ones. Return a matrix of given shape and type, filled with ones. Parameters ---------- shape : {sequence of ints, int} Shape of the matrix dtype : data-type, optional The desired data-type for the matrix, default is np.float64. order : {'C', 'F'}, optional Whether to store matrix in C- or Fortran-contiguous o... |
169,954 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
class matrix(N.ndarray):
"""
matrix(data, dtype=None, copy=True)
.. note:: It is no longer recommended to use this class, even for linear
algebra. Instead use regular arrays. The cla... | Return a matrix of given shape and type, filled with zeros. Parameters ---------- shape : int or sequence of ints Shape of the matrix dtype : data-type, optional The desired data-type for the matrix, default is float. order : {'C', 'F'}, optional Whether to store the result in C- or Fortran-contiguous order, default is... |
169,955 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
def empty(shape, dtype=None, order='C'):
"""Return a new matrix of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
Shape of the emp... | Returns the square identity matrix of given size. Parameters ---------- n : int Size of the returned identity matrix. dtype : data-type, optional Data-type of the output. Defaults to ``float``. Returns ------- out : matrix `n` x `n` matrix with its main diagonal set to one, and all other elements zero. See Also -------... |
169,956 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
def asmatrix(data, dtype=None):
"""
Interpret the input as a matrix.
Unlike `matrix`, `asmatrix` does not make a copy if the input is already
a matrix or an ndarray. Equivalent to ``matrix(da... | Return a matrix with ones on the diagonal and zeros elsewhere. Parameters ---------- n : int Number of rows in the output. M : int, optional Number of columns in the output, defaults to `n`. k : int, optional Index of the diagonal: 0 refers to the main diagonal, a positive value refers to an upper diagonal, and a negat... |
169,957 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
def asmatrix(data, dtype=None):
"""
Interpret the input as a matrix.
Unlike `matrix`, `asmatrix` does not make a copy if the input is already
a matrix or an ndarray. Equivalent to ``matrix(da... | Return a matrix of random values with given shape. Create a matrix of the given shape and propagate it with random samples from a uniform distribution over ``[0, 1)``. Parameters ---------- \\*args : Arguments Shape of the output. If given as N integers, each integer specifies the size of one dimension. If given as a t... |
169,958 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
def asmatrix(data, dtype=None):
"""
Interpret the input as a matrix.
Unlike `matrix`, `asmatrix` does not make a copy if the input is already
a matrix or an ndarray. Equivalent to ``matrix(da... | Return a random matrix with data from the "standard normal" distribution. `randn` generates a matrix filled with random floats sampled from a univariate "normal" (Gaussian) distribution of mean 0 and variance 1. Parameters ---------- \\*args : Arguments Shape of the output. If given as N integers, each integer specifie... |
169,959 | import warnings
import numpy as np
from numpy.matrixlib.defmatrix import matrix, asmatrix
from numpy import *
The provided code snippet includes necessary dependencies for implementing the `repmat` function. Write a Python function `def repmat(a, m, n)` to solve the following problem:
Repeat a 0-D to 2-D array or matr... | Repeat a 0-D to 2-D array or matrix MxN times. Parameters ---------- a : array_like The array or matrix to be repeated. m, n : int The number of times `a` is repeated along the first and second axes. Returns ------- out : ndarray The result of repeating `a`. Examples -------- >>> import numpy.matlib >>> a0 = np.array(1... |
169,960 |
class Configuration:
_list_keys = ['packages', 'ext_modules', 'data_files', 'include_dirs',
'libraries', 'headers', 'scripts', 'py_modules',
'installed_libraries', 'define_macros']
_dict_keys = ['package_dir', 'installed_pkg_config']
_extra_keys = ['name', 'version']
... | null |
169,961 | from __future__ import annotations
from ._array_object import Array
from typing import NamedTuple
import numpy as np
class UniqueAllResult(NamedTuple):
values: Array
indices: Array
inverse_indices: Array
counts: Array
class Array:
"""
n-d array object for the array API namespace.
See the d... | Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`. See its docstring for more information. |
169,962 | from __future__ import annotations
from ._array_object import Array
from typing import NamedTuple
import numpy as np
class UniqueCountsResult(NamedTuple):
class Array:
def _new(cls, x, /):
def __new__(cls, *args, **kwargs):
def __str__(self: Array, /) -> str:
def __repr__(self: Array, /) -> str:
... | null |
169,963 | from __future__ import annotations
from ._array_object import Array
from typing import NamedTuple
import numpy as np
class UniqueInverseResult(NamedTuple):
values: Array
inverse_indices: Array
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <... | Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`. See its docstring for more information. |
169,964 | from __future__ import annotations
from ._array_object import Array
from typing import NamedTuple
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
This is a wrapper around numpy.ndarra... | Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`. See its docstring for more information. |
169,965 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.asarray <numpy.asarray>`. See its docstring for more information. |
169,966 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`. See its docstring for more information. |
169,967 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`. See its docstring for more information. |
169,968 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`. See its docstring for more information. |
169,969 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`. See its docstring for more information. |
169,970 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
class Array:
def _new(cls, x, /):
def __new__(cls, *args, **kwargs):
def __str__(self: Array, /) -> str:
def __repr__(self: Array, /) -> str:
de... | null |
169,971 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.full <numpy.full>`. See its docstring for more information. |
169,972 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.full_like <numpy.full_like>`. See its docstring for more information. |
169,973 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.linspace <numpy.linspace>`. See its docstring for more information. |
169,974 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
List = _Alias()
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
infor... | Array API compatible wrapper for :py:func:`np.meshgrid <numpy.meshgrid>`. See its docstring for more information. |
169,975 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.ones <numpy.ones>`. See its docstring for more information. |
169,976 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.ones_like <numpy.ones_like>`. See its docstring for more information. |
169,977 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
This... | Array API compatible wrapper for :py:func:`np.tril <numpy.tril>`. See its docstring for more information. |
169,978 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
This... | Array API compatible wrapper for :py:func:`np.triu <numpy.triu>`. See its docstring for more information. |
169,979 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.zeros <numpy.zeros>`. See its docstring for more information. |
169,980 | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ._dtypes import _all_dtypes
import numpy as np
def _check_valid_dtype(dtype):
# Note: Only spelling dtypes as the dtype objects is supported.
# We use this instead of "dtype in _all_dtypes" because the dtype o... | Array API compatible wrapper for :py:func:`np.zeros_like <numpy.zeros_like>`. See its docstring for more information. |
169,981 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
_numeric_dtypes = (
floa... | null |
169,982 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
_floating_dtypes = (float32,... | null |
169,983 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
_numeric_dtypes = (
floa... | null |
169,984 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
float32 = np.dtype("float32"... | null |
169,985 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
_floating_dtypes = (float32,... | null |
169,986 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
float32 = np.dtype("float32"... | null |
169,987 | from __future__ import annotations
from ._dtypes import (
_floating_dtypes,
_numeric_dtypes,
)
from ._array_object import Array
from ._creation_functions import asarray
from ._dtypes import float32, float64
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy as np
_floating_dtypes = (float32,... | null |
169,988 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _all_dtypes, _result_type
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Tuple, Union
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :... | null |
169,989 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _all_dtypes, _result_type
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Tuple, Union
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :... | Array API compatible wrapper for :py:func:`np.broadcast_arrays <numpy.broadcast_arrays>`. See its docstring for more information. |
169,990 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _all_dtypes, _result_type
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Tuple, Union
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :... | Array API compatible wrapper for :py:func:`np.broadcast_to <numpy.broadcast_to>`. See its docstring for more information. |
169,991 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _all_dtypes, _result_type
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Tuple, Union
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :... | Array API compatible wrapper for :py:func:`np.can_cast <numpy.can_cast>`. See its docstring for more information. |
169,992 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _all_dtypes, _result_type
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Tuple, Union
import numpy as np
class finfo_object:
bits: int
# Note: The types of the float data here are float, whereas i... | Array API compatible wrapper for :py:func:`np.finfo <numpy.finfo>`. See its docstring for more information. |
169,993 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _all_dtypes, _result_type
from dataclasses import dataclass
from typing import TYPE_CHECKING, List, Tuple, Union
import numpy as np
class iinfo_object:
bits: int
max: int
min: int
class Array:
"""
n-d array obj... | Array API compatible wrapper for :py:func:`np.iinfo <numpy.iinfo>`. See its docstring for more information. |
169,994 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _result_type
from typing import Optional, Tuple
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
... | Array API compatible wrapper for :py:func:`np.argmax <numpy.argmax>`. See its docstring for more information. |
169,995 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _result_type
from typing import Optional, Tuple
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
... | Array API compatible wrapper for :py:func:`np.argmin <numpy.argmin>`. See its docstring for more information. |
169,996 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _result_type
from typing import Optional, Tuple
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
... | Array API compatible wrapper for :py:func:`np.nonzero <numpy.nonzero>`. See its docstring for more information. |
169,997 | from __future__ import annotations
from ._array_object import Array
from ._dtypes import _result_type
from typing import Optional, Tuple
import numpy as np
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
... | Array API compatible wrapper for :py:func:`np.where <numpy.where>`. See its docstring for more information. |
169,998 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.linalg.cholesky <numpy.linalg.cholesky>`. See its docstring for more information. |
169,999 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.cross <numpy.cross>`. See its docstring for more information. |
170,000 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.linalg.det <numpy.linalg.det>`. See its docstring for more information. |
170,001 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
c... | Array API compatible wrapper for :py:func:`np.diagonal <numpy.diagonal>`. See its docstring for more information. |
170,002 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
cl... | Array API compatible wrapper for :py:func:`np.linalg.eigh <numpy.linalg.eigh>`. See its docstring for more information. |
170,003 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.linalg.eigvalsh <numpy.linalg.eigvalsh>`. See its docstring for more information. |
170,004 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.linalg.inv <numpy.linalg.inv>`. See its docstring for more information. |
170,005 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.matmul <numpy.matmul>`. See its docstring for more information. |
170,006 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`. See its docstring for more information. |
170,007 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.matrix_power <numpy.matrix_power>`. See its docstring for more information. |
170,008 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
de... | Array API compatible wrapper for :py:func:`np.matrix_rank <numpy.matrix_rank>`. See its docstring for more information. |
170,009 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
c... | null |
170,010 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.outer <numpy.outer>`. See its docstring for more information. |
170,011 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
_... | Array API compatible wrapper for :py:func:`np.linalg.pinv <numpy.linalg.pinv>`. See its docstring for more information. |
170,012 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
cl... | Array API compatible wrapper for :py:func:`np.linalg.qr <numpy.linalg.qr>`. See its docstring for more information. |
170,013 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
cl... | Array API compatible wrapper for :py:func:`np.linalg.slogdet <numpy.linalg.slogdet>`. See its docstring for more information. |
170,014 | from __future__ import annotations
from ._dtypes import _floating_dtypes, _numeric_dtypes
from ._manipulation_functions import reshape
from ._array_object import Array
from ..core.numeric import normalize_axis_tuple
from typing import TYPE_CHECKING
from typing import NamedTuple
import numpy.linalg
import numpy as np
de... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.