id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
169,264
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods The provided code snippet includes necessary dependen...
Replaces specified elements of an array with given values. The indexing works on the flattened target array. `put` is roughly equivalent to: :: a.flat[ind] = v Parameters ---------- a : ndarray Target array. ind : array_like Target indices, interpreted as integers. v : array_like Values to place in `a` at target indice...
169,265
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _swapaxes_dispatcher(a, axis1, axis2): return...
null
169,266
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _transpose_dispatcher(a, axes=None): return (...
null
169,267
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _partition_dispatcher(a, kth, axis=None, kind=Non...
null
169,268
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _argpartition_dispatcher(a, kth, axis=None, kind=...
null
169,269
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _wrapfunc(obj, method, *args, **kwds): bound =...
Perform an indirect partition along the given axis using the algorithm specified by the `kind` keyword. It returns an array of indices of the same shape as `a` that index data along the given axis in partitioned order. .. versionadded:: 1.8.0 Parameters ---------- a : array_like Array to sort. kth : int or sequence of ...
169,270
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _sort_dispatcher(a, axis=None, kind=None, order=N...
null
169,271
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _argsort_dispatcher(a, axis=None, kind=None, orde...
null
169,272
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _argmax_dispatcher(a, axis=None, out=None, *, kee...
null
169,273
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _wrapfunc(obj, method, *args, **kwds): bound =...
Returns the indices of the maximum values along an axis. Parameters ---------- a : array_like Input array. axis : int, optional By default, the index is into the flattened array, otherwise along the specified axis. out : array, optional If provided, the result will be inserted into this array. It should be of the appro...
169,274
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _argmin_dispatcher(a, axis=None, out=None, *, kee...
null
169,275
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _wrapfunc(obj, method, *args, **kwds): bound =...
Returns the indices of the minimum values along an axis. Parameters ---------- a : array_like Input array. axis : int, optional By default, the index is into the flattened array, otherwise along the specified axis. out : array, optional If provided, the result will be inserted into this array. It should be of the appro...
169,276
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _searchsorted_dispatcher(a, v, side=None, sorter=...
null
169,277
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _resize_dispatcher(a, new_shape): return (a,)
null
169,278
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def reshape(a, newshape, order='C'): """ Gives...
Return a new array with the specified shape. If the new array is larger than the original array, then the new array is filled with repeated copies of `a`. Note that this behavior is different from a.resize(new_shape) which fills with zeros instead of repeated copies of `a`. Parameters ---------- a : array_like Array to...
169,279
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _squeeze_dispatcher(a, axis=None): return (a,...
null
169,280
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _diagonal_dispatcher(a, offset=None, axis1=None, ...
null
169,281
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods asarray.__module__ = 'numpy' asanyarray.__module__ = ...
Return specified diagonals. If `a` is 2-D, returns the diagonal of `a` with the given offset, i.e., the collection of elements of the form ``a[i, i+offset]``. If `a` has more than two dimensions, then the axes specified by `axis1` and `axis2` are used to determine the 2-D sub-array whose diagonal is returned. The shape...
169,282
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _trace_dispatcher( a, offset=None, axis1=...
null
169,283
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods asarray.__module__ = 'numpy' asanyarray.__module__ = ...
Return the sum along diagonals of the array. If `a` is 2-D, the sum along its diagonal with the given offset is returned, i.e., the sum of elements ``a[i,i+offset]`` for all i. If `a` has more than two dimensions, then the axes specified by axis1 and axis2 are used to determine the 2-D sub-arrays whose traces are retur...
169,284
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _ravel_dispatcher(a, order=None): return (a,)
null
169,285
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _nonzero_dispatcher(a): return (a,)
null
169,286
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _shape_dispatcher(a): return (a,)
null
169,287
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _compress_dispatcher(condition, a, axis=None, out...
null
169,288
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _wrapfunc(obj, method, *args, **kwds): bound =...
Return selected slices of an array along given axis. When working along a given axis, a slice along that axis is returned in `output` for each index where `condition` evaluates to True. When working on a 1-D array, `compress` is equivalent to `extract`. Parameters ---------- condition : 1-D array of bools Array that se...
169,289
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _clip_dispatcher(a, a_min, a_max, out=None, **kwa...
null
169,290
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _sum_dispatcher(a, axis=None, dtype=None, out=Non...
null
169,291
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _any_dispatcher(a, axis=None, out=None, keepdims=...
null
169,292
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _all_dispatcher(a, axis=None, out=None, keepdims=...
null
169,293
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _cumsum_dispatcher(a, axis=None, dtype=None, out=...
null
169,294
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _ptp_dispatcher(a, axis=None, out=None, keepdims=...
null
169,295
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods The provided code snippet includes necessary dependen...
Range of values (maximum - minimum) along an axis. The name of the function comes from the acronym for 'peak to peak'. .. warning:: `ptp` preserves the data type of the array. This means the return value for an input of signed integers with n bits (e.g. `np.int8`, `np.int16`, etc) is also a signed integer with n bits. ...
169,296
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _amax_dispatcher(a, axis=None, out=None, keepdims...
null
169,297
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _wrapreduction(obj, ufunc, method, axis, dtype, ou...
Return the maximum of an array or maximum along an axis. Parameters ---------- a : array_like Input data. axis : None or int or tuple of ints, optional Axis or axes along which to operate. By default, flattened input is used. .. versionadded:: 1.7.0 If this is a tuple of ints, the maximum is selected over multiple axes...
169,298
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _amin_dispatcher(a, axis=None, out=None, keepdims...
null
169,299
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _wrapreduction(obj, ufunc, method, axis, dtype, ou...
Return the minimum of an array or minimum along an axis. Parameters ---------- a : array_like Input data. axis : None or int or tuple of ints, optional Axis or axes along which to operate. By default, flattened input is used. .. versionadded:: 1.7.0 If this is a tuple of ints, the minimum is selected over multiple axes...
169,300
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _prod_dispatcher(a, axis=None, dtype=None, out=No...
null
169,301
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _cumprod_dispatcher(a, axis=None, dtype=None, out...
null
169,302
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _ndim_dispatcher(a): return (a,)
null
169,303
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _size_dispatcher(a, axis=None): return (a,)
null
169,304
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _around_dispatcher(a, decimals=None, out=None): ...
null
169,305
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _mean_dispatcher(a, axis=None, dtype=None, out=No...
null
169,306
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _std_dispatcher(a, axis=None, dtype=None, out=Non...
null
169,307
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods The provided code snippet includes necessary dependen...
Compute the standard deviation along the specified axis. Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis. Parameters ---------- a : array_like Calculate the standard...
169,308
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def _var_dispatcher(a, axis=None, dtype=None, out=Non...
null
169,309
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods The provided code snippet includes necessary dependen...
Compute the variance along the specified axis. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, otherwise over the specified axis. Parameters ---------- a : array_like Array containing numbers whose variance is desired. I...
169,310
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def around(a, decimals=0, out=None): """ Evenl...
Round an array to the given number of decimals. See Also -------- around : equivalent function; see for details.
169,311
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def cumprod(a, axis=None, dtype=None, out=None): "...
Return the cumulative product over the given axis. See Also -------- cumprod : equivalent function; see for details.
169,312
import functools import types import warnings import numpy as np from . import multiarray as mu from . import overrides from . import umath as um from . import numerictypes as nt from .multiarray import asarray, array, asanyarray, concatenate from . import _methods def all(a, axis=None, out=None, keepdims=np._NoValue, ...
Check if all elements of input array are true. See Also -------- numpy.all : Equivalent function; see for details.
169,313
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
Return the scalar type of highest precision of the same kind as the input. Parameters ---------- t : dtype or dtype specifier The input data type. This can be a `dtype` object or an object that is convertible to a `dtype`. Returns ------- out : dtype The highest precision data type of the same kind (`dtype.kind`) as `t...
169,314
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
Determines whether the given object represents a scalar data-type. Parameters ---------- rep : any If `rep` is an instance of a scalar dtype, True is returned. If not, False is returned. Returns ------- out : bool Boolean result of check whether `rep` is a scalar dtype. See Also -------- issubsctype, issubdtype, obj2sc...
169,315
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
Determine if the first argument is a subclass of the second argument. Parameters ---------- arg1, arg2 : dtype or dtype specifier Data-types. Returns ------- out : bool The result. See Also -------- issctype, issubdtype, obj2sctype Examples -------- >>> np.issubsctype('S8', str) False >>> np.issubsctype(np.array([1]), ...
169,316
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
null
169,317
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
Return the string representation of a scalar dtype. Parameters ---------- sctype : scalar dtype or object If a scalar dtype, the corresponding string character is returned. If an object, `sctype2char` tries to infer its scalar type and then return the corresponding string character. Returns ------- typechar : str The s...
169,318
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
A ``key`` function for `sorted`.
169,319
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
null
169,320
import numbers from numpy.core.multiarray import ( ndarray, array, dtype, datetime_data, datetime_as_string, busday_offset, busday_count, is_busday, busdaycalendar ) from numpy.core.overrides import set_module from ._string_helpers import ( english_lower, english_upper, english_capitalize, L...
Determine common type following standard coercion rules. Parameters ---------- array_types : sequence A list of dtypes or dtype convertible objects representing arrays. scalar_types : sequence A list of dtypes or dtype convertible objects representing scalars. Returns ------- datatype : dtype The common data type, whic...
169,329
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,330
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,331
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,332
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,333
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,334
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Return a full array with the same shape and type as a given array. Parameters ---------- a : array_like The shape and data-type of `a` define these same attributes of the returned array. fill_value : array_like Fill value. dtype : data-type, optional Overrides the data type of the result. order : {'C', 'F', 'A', or 'K'...
169,335
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,336
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Check if the array is Fortran contiguous but *not* C contiguous. This function is obsolete and, because of changes due to relaxed stride checking, its return value for the same array may differ for versions of NumPy >= 1.10.0 and previous versions. If you only want to check if an array is Fortran contiguous use ``a.fla...
169,337
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,338
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Find the indices of array elements that are non-zero, grouped by element. Parameters ---------- a : array_like Input data. Returns ------- index_array : (N, a.ndim) ndarray Indices of elements that are non-zero. Indices are grouped by element. This array will have shape ``(N, a.ndim)`` where ``N`` is the number of non-...
169,339
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,340
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,341
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,342
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,343
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,344
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,345
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Roll array elements along a given axis. Elements that roll beyond the last position are re-introduced at the first. Parameters ---------- a : array_like Input array. shift : int or tuple of ints The number of places by which elements are shifted. If a tuple, then `axis` must be a tuple of the same size, and each of the...
169,346
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,347
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Roll the specified axis backwards, until it lies in a given position. This function continues to be supported for backward compatibility, but you should prefer `moveaxis`. The `moveaxis` function was added in NumPy 1.11. Parameters ---------- a : ndarray Input array. axis : int The axis to be rolled. The positions of t...
169,348
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,349
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,350
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Return the cross product of two (arrays of) vectors. The cross product of `a` and `b` in :math:`R^3` is a vector perpendicular to both `a` and `b`. If `a` and `b` are arrays of vectors, the vectors are defined by the last axis of `a` and `b` by default, and these axes can have dimensions 2 or 3. Where the dimension of ...
169,351
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,352
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Construct an array by executing a function over each coordinate. The resulting array therefore has a value ``fn(x, y, z)`` at coordinate ``(x, y, z)``. Parameters ---------- function : callable The function is called with N parameters, where N is the rank of `shape`. Each parameter represents the coordinates of the arr...
169,353
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,354
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Return the binary representation of the input number as a string. For negative numbers, if width is not given, a minus sign is added to the front. If width is given, the two's complement of the number is returned, with respect to that width. In a two's-complement system negative numbers are represented by the two's com...
169,355
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Return a string representation of a number in the given base system. Parameters ---------- number : int The value to convert. Positive and negative values are handled. base : int, optional Convert `number` to the `base` number system. The valid range is 2-36, the default value is 2. padding : int, optional Number of ze...
169,356
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,357
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,358
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Return the identity array. The identity array is a square array with ones on the main diagonal. Parameters ---------- n : int Number of rows (and columns) in `n` x `n` output. dtype : data-type, optional Data-type of the output. Defaults to ``float``. ${ARRAY_FUNCTION_LIKE} .. versionadded:: 1.20.0 Returns ------- out ...
169,359
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,360
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,361
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,362
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
True if two arrays have the same shape and elements, False otherwise. Parameters ---------- a1, a2 : array_like Input arrays. equal_nan : bool Whether to compare NaN's as equal. If the dtype of a1 and a2 is complex, values will be considered equal if either the real or the imaginary component of a given value is ``nan`...
169,363
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,364
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
Returns True if input arrays are shape consistent and all elements equal. Shape consistent means they are either the same shape, or one input array can be broadcasted to create the same shape as the other one. Parameters ---------- a1, a2 : array_like Input arrays. Returns ------- out : bool True if equivalent, False o...
169,365
import functools import itertools import operator import sys import warnings import numbers import numpy as np from . import multiarray from .multiarray import ( fastCopyAndTranspose, ALLOW_THREADS, BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE, WRAP, arange, array, asarray, asanyarray, a...
null
169,488
LOWER_TABLE = "".join(_all_chars[:65] + _ascii_lower + _all_chars[65+26:]) The provided code snippet includes necessary dependencies for implementing the `english_lower` function. Write a Python function `def english_lower(s)` to solve the following problem: Apply English case rules to convert ASCII strings to all low...
Apply English case rules to convert ASCII strings to all lower case. This is an internal utility function to replace calls to str.lower() such that we can avoid changing behavior with changing locales. In particular, Turkish has distinct dotted and dotless variants of the Latin letter "I" in both lowercase and uppercas...
169,489
def english_upper(s): """ Apply English case rules to convert ASCII strings to all upper case. This is an internal utility function to replace calls to str.upper() such that we can avoid changing behavior with changing locales. In particular, Turkish has distinct dotted and dotless variants of the Latin...
Apply English case rules to convert the first character of an ASCII string to upper case. This is an internal utility function to replace calls to str.capitalize() such that we can avoid changing behavior with changing locales. Parameters ---------- s : str Returns ------- capitalized : str Examples -------- >>> from n...
169,503
import functools from . import overrides from . import _multiarray_umath from ._multiarray_umath import * from ._multiarray_umath import ( fastCopyAndTranspose, _flagdict, from_dlpack, _insert, _reconstruct, _vec_string, _ARRAY_API, _monotonicity, _get_ndarray_c_version, _get_madvise_hugepage, _set_madvise...
inner(a, b, /) Inner product of two arrays. Ordinary inner product of vectors for 1-D arrays (without complex conjugation), in higher dimensions a sum product over the last axes. Parameters ---------- a, b : array_like If `a` and `b` are nonscalar, their last dimensions must match. Returns ------- out : ndarray If `a` ...
169,504
import functools from . import overrides from . import _multiarray_umath from ._multiarray_umath import * from ._multiarray_umath import ( fastCopyAndTranspose, _flagdict, from_dlpack, _insert, _reconstruct, _vec_string, _ARRAY_API, _monotonicity, _get_ndarray_c_version, _get_madvise_hugepage, _set_madvise...
lexsort(keys, axis=-1) Perform an indirect stable sort using a sequence of keys. Given multiple sorting keys, which can be interpreted as columns in a spreadsheet, lexsort returns an array of integer indices that describes the sort order by multiple columns. The last key in the sequence is used for the primary sort ord...
169,505
import functools from . import overrides from . import _multiarray_umath from ._multiarray_umath import * from ._multiarray_umath import ( fastCopyAndTranspose, _flagdict, from_dlpack, _insert, _reconstruct, _vec_string, _ARRAY_API, _monotonicity, _get_ndarray_c_version, _get_madvise_hugepage, _set_madvise...
can_cast(from_, to, casting='safe') Returns True if cast between data types can occur according to the casting rule. If from is a scalar or array scalar, also returns True if the scalar value can be cast without overflow or truncation to an integer. Parameters ---------- from_ : dtype, dtype specifier, scalar, or array...
169,506
import functools from . import overrides from . import _multiarray_umath from ._multiarray_umath import * from ._multiarray_umath import ( fastCopyAndTranspose, _flagdict, from_dlpack, _insert, _reconstruct, _vec_string, _ARRAY_API, _monotonicity, _get_ndarray_c_version, _get_madvise_hugepage, _set_madvise...
min_scalar_type(a, /) For scalar ``a``, returns the data type with the smallest size and smallest scalar kind which can hold its value. For non-scalar array ``a``, returns the vector's dtype unmodified. Floating point values are not demoted to integers, and complex values are not demoted to floats. Parameters ---------...