ndarray

Standard library class numpy.ndarray.ndarray View source
class ndarray
@tuple
class ndarray[dtype, ndim]
Fields 2
dtype type
ndim Literal[int]
Constructors 2
__new__
__new__(shape: Tuple[ndim, int], strides: Tuple[ndim, int], data: Ptr[dtype])
Defined in numpy.ndarray
__new__
__new__(shape: Tuple[ndim, int], data: Ptr[dtype], fcontig: bool = False)
Defined in numpy.ndarray
Properties 11
shape
@property
shape(self)
Defined in numpy.ndarray
strides
@property
strides(self)
Defined in numpy.ndarray
flags
@property
flags(self)
Defined in numpy.ndarray
data
@property
data(self)
Defined in numpy.ndarray
size
@property
size(self)
Defined in numpy.ndarray
itemsize
@property
itemsize(self)
Defined in numpy.ndarray
nbytes
@property
nbytes(self)
Defined in numpy.ndarray
T
@property
T(self)
Defined in numpy.ndarray
flat
@property
flat(self)
Defined in numpy.ndarray
real
@property
real(self)
imag
@property
imag(self)
Methods 54
item
item(self, *args)
Defined in numpy.ndarray
transpose
transpose(self, *axes)
Defined in numpy.ndarray
transpose(self, axes: List[int])
Defined in numpy.ndarray
swapaxes
swapaxes(self, axis1: int, axis2: int)
Defined in numpy.ndarray
reshape
reshape(self, *shape, order: str = "C")
Defined in numpy.ndarray
tobytes
tobytes(self, order: str = "C")
Defined in numpy.ndarray
ravel
ravel(self, order: str = "C")
Defined in numpy.ndarray
flatten
flatten(self, order: str = "C")
Defined in numpy.ndarray
flat
flat(self, value)
Defined in numpy.ndarray
flat(self, val)
tolist
tolist(self)
Defined in numpy.ndarray
astype
astype(self, dtype: type, order: str = "K", copy: bool = True)
Defined in numpy.ndarray
copy
copy(self, order: str = "C")
Defined in numpy.ndarray
map
map(self, fn, inplace: Literal[bool] = False)
Defined in numpy.ndarray
fill
fill(self, value)
Defined in numpy.ndarray
view
view(self, dtype: type)
Defined in numpy.ndarray
byteswap
byteswap(self, inplace: bool = False)
Defined in numpy.ndarray
sort
sort(self, axis: int = -1, kind: Optional[str] = None)
Added by numpy.sorting
argsort
argsort(self, axis: int = -1, kind: Optional[str] = None)
Added by numpy.sorting
partition
partition(self, kth, axis: int = -1, kind: str = "introselect")
Added by numpy.sorting
argpartition
argpartition(self, kth, axis: int = -1, kind: str = "introselect")
Added by numpy.sorting
take
take(self, indices, axis = None, out = None, mode: str = "raise")
squeeze
squeeze(self, axis = None)
nonzero
nonzero(self)
searchsorted
searchsorted(self, v, side: str = "left", sorter = None)
repeat
repeat(self, repeats, axis = None)
compress
compress(self, condition, axis = None, out = None)
choose
choose(self, choices, out = None, mode: str = "raise")
diagonal
diagonal(self, offset: int = 0, axis1: int = 0, axis2: int = 1)
put
put(self, ind, v, mode: str = "raise")
round
round(self, decimals: int = 0, out = None)
clip
clip(self, min = None, max = None, out = None)
real
real(self, val)
imag
imag(self, val)
conj
conj(self)
conjugate
conjugate(self)
sum
sum(self, axis = None, dtype: type = NoneType, out = None, keepdims: Literal[bool] = False, initial = 0, where = util._NoValue())
prod
prod(self, axis = None, dtype: type = NoneType, out = None, keepdims: Literal[bool] = False, initial = 1, where = util._NoValue())
mean
mean(self, axis = None, dtype: type = NoneType, out = None, keepdims: Literal[bool] = False, where = util._NoValue())
nanmean
nanmean(self, axis = None, dtype: type = NoneType, out = None, keepdims: Literal[bool] = False, where = util._NoValue())
var
var(self, axis = None, dtype: type = NoneType, out = None, ddof: int = 0, keepdims: Literal[bool] = False, where = util._NoValue())
nanvar
nanvar(self, axis = None, dtype: type = NoneType, out = None, ddof: int = 0, keepdims: Literal[bool] = False, where = util._NoValue())
std
std(self, axis = None, dtype: type = NoneType, out = None, ddof: int = 0, keepdims: Literal[bool] = False, where = util._NoValue())
nanstd
nanstd(self, axis = None, dtype: type = NoneType, out = None, ddof: int = 0, keepdims: Literal[bool] = False, where = util._NoValue())
min
min(self, axis = None, dtype: type = NoneType, out = None, ddof: int = 0, keepdims: Literal[bool] = False, initial = util._NoValue(), where = util._NoValue())
ptp
ptp(self, axis = None, out = None, keepdims: Literal[bool] = False)
max
max(self, axis = None, dtype: type = NoneType, out = None, ddof: int = 0, keepdims: Literal[bool] = False, initial = util._NoValue(), where = util._NoValue())
argmin
argmin(self, axis = None, out = None, keepdims: Literal[bool] = False)
argmax
argmax(self, axis = None, out = None, keepdims: Literal[bool] = False)
any
any(self, axis = None, out = None, keepdims: Literal[bool] = False, where = util._NoValue())
all
all(self, axis = None, out = None, keepdims: Literal[bool] = False, where = util._NoValue())
cumprod
cumprod(self, axis = None, dtype: type = NoneType, out = None)
Added by numpy.ndmath
cumsum
cumsum(self, axis = None, dtype: type = NoneType, out = None)
Added by numpy.ndmath
dot
dot(self, other)
trace
trace(self, offset: int = 0, axis1: int = 0, axis2: int = 1, dtype: type = NoneType, out = None)
tofile
tofile(self, file, sep: str = "")
Added by numpy.npio
Special methods 65
__len__
__len__(self)
Defined in numpy.ndarray
__iter__
__iter__(self)
Defined in numpy.ndarray
__copy__
__copy__(self)
Defined in numpy.ndarray
__int__
__int__(self)
Defined in numpy.ndarray
__float__
__float__(self)
Defined in numpy.ndarray
__complex__
__complex__(self)
Defined in numpy.ndarray
__bool__
__bool__(self)
Defined in numpy.ndarray
__to_py__
__to_py__(self)
__from_py__
__from_py__(a: cobj)
__abs__
@inline
__abs__(self)
Added by numpy.ndmath
__to_gpu__
__to_gpu__(self, cache: gpu.AllocCache)
Added by numpy.ndgpu
__from_gpu__
__from_gpu__(self, other: ndarray[dtype, ndim])
Added by numpy.ndgpu
__from_gpu_new__
__from_gpu_new__(other: ndarray[dtype, ndim])
Added by numpy.ndgpu
__matmul__
__matmul__(self, other)
__add__
@inline
__add__(self, other)
__radd__
@inline
__radd__(self, other)
__iadd__
@inline
__iadd__(self, other)
__sub__
@inline
__sub__(self, other)
__rsub__
@inline
__rsub__(self, other)
__isub__
@inline
__isub__(self, other)
__mul__
@inline
__mul__(self, other)
__rmul__
@inline
__rmul__(self, other)
__imul__
@inline
__imul__(self, other)
__mod__
@inline
__mod__(self, other)
__rmod__
@inline
__rmod__(self, other)
__imod__
@inline
__imod__(self, other)
__pow__
@inline
__pow__(self, other)
__rpow__
@inline
__rpow__(self, other)
__ipow__
@inline
__ipow__(self, other)
__truediv__
@inline
__truediv__(self, other)
__rtruediv__
@inline
__rtruediv__(self, other)
__itruediv__
@inline
__itruediv__(self, other)
__floordiv__
@inline
__floordiv__(self, other)
__rfloordiv__
@inline
__rfloordiv__(self, other)
__ifloordiv__
@inline
__ifloordiv__(self, other)
__lshift__
@inline
__lshift__(self, other)
__rlshift__
@inline
__rlshift__(self, other)
__ilshift__
@inline
__ilshift__(self, other)
__rshift__
@inline
__rshift__(self, other)
__rrshift__
@inline
__rrshift__(self, other)
__irshift__
@inline
__irshift__(self, other)
__and__
@inline
__and__(self, other)
__rand__
@inline
__rand__(self, other)
__iand__
@inline
__iand__(self, other)
__or__
@inline
__or__(self, other)
__ror__
@inline
__ror__(self, other)
__ior__
@inline
__ior__(self, other)
__xor__
@inline
__xor__(self, other)
__rxor__
@inline
__rxor__(self, other)
__ixor__
@inline
__ixor__(self, other)
__pos__
@inline
__pos__(self)
__neg__
@inline
__neg__(self)
__invert__
@inline
__invert__(self)
__eq__
@inline
__eq__(self, other)
__ne__
@inline
__ne__(self, other)
__lt__
@inline
__lt__(self, other)
__le__
@inline
__le__(self, other)
__gt__
@inline
__gt__(self, other)
__ge__
@inline
__ge__(self, other)
__repr__
__repr__(self)
Added by numpy.format
__str__
__str__(self)
Added by numpy.format
__getitem__
__getitem__(self, indexes)
__setitem__
__setitem__(self, indexes, item)
__pickle__
__pickle__(self, jar: Jar)
Added by numpy.npio
__unpickle__
__unpickle__(jar: Jar)
Added by numpy.npio