Skip to content

module numpy.routines

Source: stdlib/numpy/routines.codon


array(a, dtype: type = NoneType, copy: bool = True, order: str = "K", ndmin: Literal[int] = 0)


asarray(a, dtype: type = NoneType, order: str = "K")


asanyarray(a, dtype: type = NoneType, order: str = "K")


asarray_chkfinite(a, dtype: type = NoneType, order: str = "K")


empty(shape, dtype: type = float, order: str = "C")


empty_like(prototype, dtype: type = NoneType, order: str = "K", shape = None)


zeros(shape, dtype: type = float, order: str = "C")


zeros_like(prototype, dtype: type = NoneType, order: str = "K")


ones(shape, dtype: type = float, order: str = "C")


ones_like(prototype, dtype: type = NoneType, order: str = "K")


identity(n: int, dtype: type = float)


eye(N: int, M: Optional[int] = None, k: int = 0, dtype: type = float, order: str = "C")


diag(v, k: int = 0)


diagflat(v, k: int = 0)


tri(N: int, M: Optional[int] = None, k: int = 0, dtype: type = float)


triu(x, k: int = 0)


tril(x, k: int = 0)


vander(x, N: Optional[int] = None, increasing: bool = False)


arange(start: float, stop: float, step: float, dtype: type = float)


arange(stop: float, step: float, dtype: type = float) @overload Function is overloaded


arange(start: float, stop: float, dtype: type = float) @overload Function is overloaded


arange(stop: float, dtype: type = float) @overload Function is overloaded


arange(start: int, stop: int, step: int, dtype: type = int) @overload Function is overloaded


arange(stop: int, step: int, dtype: type = int) @overload Function is overloaded


arange(start: int, stop: int, dtype: type = int) @overload Function is overloaded


arange(stop: int, dtype: type = int) @overload Function is overloaded


arange(start: datetime64, stop, step = None, dtype: type = NoneType) @overload Function is overloaded


arange(start: timedelta64, stop, step, dtype: type = NoneType) @overload Function is overloaded


arange(start: timedelta64, stop, dtype: type = NoneType) @overload Function is overloaded


arange(stop: timedelta64, dtype: type = NoneType) @overload Function is overloaded


arange(start: str, stop, step = None, dtype: type = datetime64[("D", 1)]) @overload Function is overloaded


linspace(start: float, stop: float, num: int = 50, endpoint: bool = True, retstep: Literal[bool] = False, dtype: type = float)


linspace(start: float, stop: float, num: int = 50, endpoint: bool = True, retstep: Literal[bool] = False, dtype: type = float)


logspace(start: float, stop: float, num: int = 50, endpoint: bool = True, base: float = 10.0, retstep: Literal[bool] = False, dtype: type = float)


geomspace(start: float, stop: float, num: int = 50, endpoint: bool = True, dtype: type = float)


fromfunction(function, shape, dtype: type = float, **kwargs)


fromiter(iterable, dtype: type, count: int = -1)


frombuffer(buffer: str, dtype: type = float, count: int = -1, offset: int = 0)


broadcast_shapes(*args)


broadcast_to(x, shape)


broadcast_arrays(*args)


meshgrid(*xi, copy: bool = True, sparse: Literal[bool] = False, indexing: Literal[str] = "xy")


broadcast(*args)


full(shape, fill_value, dtype: type = NoneType, order: str = "C")


full_like(prototype, fill_value, dtype: type = NoneType, order: str = "K")


copyto(dst: ndarray, src, where = True)


ndim(a)


size(a, axis: Optional[int] = None)


shape(a)


reshape(a, newshape, order: str = "C")


transpose(a, axes = None)


ravel(a, order: str = "C")


ascontiguousarray(a, dtype: type = NoneType)


asfortranarray(a, dtype: type = NoneType)


asfarray(a, dtype: type = float)


moveaxis(a, source, destination)


swapaxes(a, axis1: int, axis2: int)


atleast_1d(*arys)


atleast_2d(*arys)


atleast_3d(*arys)


require(a, dtype: type = NoneType, requirements = None)


concatenate(arrays, axis = 0, out = None, dtype: type = NoneType)


expand_dims(a, axis)


stack(arrays, axis: int = 0, out = None, dtype: type = NoneType)


vstack(tup, dtype: type = NoneType)


hstack(tup, dtype: type = NoneType)


dstack(tup)


row_stack = vstack


column_stack(tup)


repeat(a, repeats, axis = None)


delete(arr, obj, axis = None)


append(arr, values, axis = None)


insert(arr, obj, values, axis = None)


array_split(ary, indices_or_sections, axis: int = 0)


split(ary, indices_or_sections, axis: int = 0)


vsplit(ary, indices_or_sections)


hsplit(ary, indices_or_sections)


dsplit(ary, indices_or_sections)


trim_zeros(filt, trim: str = "fb")


flip(m, axis = None)


fliplr(m)


flipud(m)


rot90(m, k: int = 1, axes: Tuple[int, int] = (0, 1))


resize(a, new_shape)


tile(A, reps)


roll(a, shift, axis = None)


block(arrays)


isclose(a, b, rtol: float = 1e-05, atol: float = 1e-08, equal_nan: bool = False)


allclose(a, b, rtol: float = 1e-05, atol: float = 1e-08, equal_nan: bool = False)


array_equal(a1, a2, equal_nan: bool = False)


array_equiv(a1, a2)


squeeze(a, axis = None)


pad(array, pad_width, mode = "constant", **kwargs)


nonzero(a)


flatnonzero(a)


argwhere(a)


where(condition, x, y)


where(condition) @overload Function is overloaded


extract(condition, arr)


searchsorted(a, v, side: str = "left", sorter = None)


take(a, indices, axis = None, out = None, mode: str = "raise")


indices(dimensions, dtype: type = int, sparse: Literal[bool] = False)


ix_(*args)


ravel_multi_index(multi_index, dims, mode: str = "raise", order: str = "C")


unravel_index(indices, shape, order: str = "C")


diag_indices(n: int, ndim: int)


diag_indices(n: int, ndim: Literal[int] = 2) @overload Function is overloaded


diag_indices_from(arr)


mask_indices(n: int, mask_func, k = 0)


tril_indices(n: int, k: int = 0, m: Optional[int] = None)


tril_indices_from(arr, k: int = 0)


triu_indices(n: int, k: int = 0, m: Optional[int] = None)


triu_indices_from(arr, k: int = 0)


take_along_axis(arr, indices, axis)


choose(a, choices, out = None, mode: str = "raise")


compress(condition, a, axis = None, out = None)


diagonal(a, offset: int = 0, axis1: int = 0, axis2: int = 1)


select(condlist: List, choicelist: List, default = 0)


place(arr: ndarray, mask, vals)


put(a: ndarray, ind, v, mode: str = "raise")


put_along_axis(arr: ndarray, indices, values, axis)


putmask(a: ndarray, mask, values)


fill_diagonal(a: ndarray, val, wrap: bool = False)


round(a, decimals: int = 0, out = None)


around = round


clip(a, a_min, a_max, out = None)


ndenumerate(arr)


ndindex(*shape)


iterable(y)


packbits(a, axis = None, bitorder: str = "big")


unpackbits(a, axis = None, count = None, bitorder: str = "big")


isposinf(x, out = None)


isneginf(x, out = None)


iscomplex(x)


iscomplexobj(x)


isreal(x)


isrealobj(x)


isfortran(a: ndarray)


isscalar(element)


real(val)


imag(val)


ndarray[dtype,ndim] @extend Class is extended to add given methods

Properties

real @property Method is a class property

imag @property Method is a class property

Methods

take(self, indices, axis = None, out = None, mode: str = "raise")

squeeze(self, axis = None)

nonzero(self)

searchsorted(self, v, side: str = "left", sorter = None)

repeat(self, repeats, axis = None)

compress(self, condition, axis = None, out = None)

choose(self, choices, out = None, mode: str = "raise")

diagonal(self, offset: int = 0, axis1: int = 0, axis2: int = 1)

put(self, ind, v, mode: str = "raise")

round(self, decimals: int = 0, out = None)

clip(self, min = None, max = None, out = None)

real(self, val)

imag(self, val)

conj(self)

conjugate(self)

flat(self, val)


busdaycalendar @extend Class is extended to add given methods

Properties

weekmask @property Method is a class property

holidays @property Method is a class property


busday_offset(dates, offsets, roll: str = "raise", weekmask = None, holidays = None, busdaycal = None, out = None)


busday_count(begindates, enddates, weekmask = None, holidays = None, busdaycal = None, out = None)


is_busday(dates, weekmask = None, holidays = None, busdaycal = None, out = None)


datetime_data(dtype: type)


datetime_as_string(arr, unit = None, timezone: str = "naive")