NDArray Methods
TheNDArray class (from the default numpy-ts entry point) provides chainable instance methods that delegate to the corresponding standalone functions. Each method below calls its standalone equivalent under the hood.
These methods are only available on
NDArray (the full entry point). NDArrayCore from numpy-ts/core does not include them. See the NDArray Class page for core methods available on both classes.Arithmetic methods
add
subtract
multiply
divide
floor_divide
mod
remainder
mod). See remainder.
fmod
power
negative
-x). See negative.
positive
+x). Returns a copy. See positive.
absolute
reciprocal
1/x). See reciprocal.
square
x**2). See square.
sqrt
cbrt
fabs
sign
heaviside
divmod
Exponential and logarithmic methods
exp
e^x). See exp.
exp2
2^x). See exp2.
expm1
e^x - 1, accurate for small x. See expm1.
log
log2
log10
log1p
ln(1 + x), accurate for small x. See log1p.
logaddexp
log(exp(x1) + exp(x2)), numerically stable. See logaddexp.
logaddexp2
log2(2^x1 + 2^x2), numerically stable. See logaddexp2.
Trigonometric methods
sin
cos
tan
arcsin
arccos
arctan
arctan2
this/other, choosing the correct quadrant. See arctan2.
hypot
degrees
radians
Hyperbolic methods
sinh
cosh
tanh
arcsinh
arccosh
arctanh
Rounding methods
ceil
floor
fix
rint
trunc
around
round
around. See around.
clip
[a_min, a_max]. Pass null for no bound on either side. See clip.
Comparison methods
equal
not_equal
greater
greater_equal
less
less_equal
allclose
true if all elements are equal within tolerance. Default rtol=1e-5, atol=1e-8. See allclose.
isclose
isnan
isinf
isfinite
isnat
false (no datetime support). See isnat.
Logic methods
logical_and
logical_or
logical_not
logical_xor
invert
bitwise_not). See invert.
bitwise_and
bitwise_or
bitwise_xor
bitwise_not
left_shift
right_shift
copysign
this to that of x2, element-wise. See copysign.
signbit
true where the sign bit is set (negative). See signbit.
nextafter
this towards x2. See nextafter.
spacing
Reduction methods
sum
undefined. See sum.
prod
mean
std
ddof defaults to 0. See std.
var
ddof defaults to 0. See var.
min
max
argmin
argmax
all
true. See all.
any
true. See any.
ptp
median
percentile
quantile
average
cumsum
cumprod
diff
nansum
nanprod
nanmean
nanstd
nanvar
nanmin
nanmax
nanargmin
nanargmax
nanmedian
nancumsum
nancumprod
nanpercentile
nanquantile
Shape methods
reshape
-1 for one inferred dimension. See reshape.
flatten
ravel
squeeze
expand_dims
transpose
swapaxes
moveaxis
T
Linear algebra methods
dot
matmul
@ operator equivalent). See matmul.
inner
outer
a[i] * b[j]). See outer.
tensordot
trace
diagonal
Sorting and searching methods
sort
argsort
partition
kth position is in its final sorted position. See partition.
argpartition
searchsorted
nonzero
argwhere
(N, ndim). See argwhere.
Indexing methods
take
put
choose
this as the index. See choose.
compress
condition is true. See compress.
repeat
resize
bindex
mask is true. See compress.
iindex
Complex number methods
conj
conjugate
conj. See conj.
Other methods
copy
astype
fill
toArray
tolist
toArray. See NDArray Class.
tobytes
get
set
slice
row
i. See NDArray Class.
col
j. See NDArray Class.