> ## Documentation Index
> Fetch the complete documentation index at: https://numpyts.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# NDArray Methods

> All 100+ chainable instance methods on NDArray, grouped by category.

# NDArray Methods

The `NDArray` 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.

```typescript theme={null}
import * as np from 'numpy-ts';

// Method chaining
const result = np.arange(12)
  .reshape(3, 4)
  .multiply(2)
  .sum(0);

// Equivalent standalone calls
const a = np.arange(12);
const b = np.reshape(a, [3, 4]);
const c = np.multiply(b, 2);
const d = np.sum(c, 0);
```

<Note>
  These methods are only available on `NDArray` (the full entry point). `NDArrayCore` from `numpy-ts/core` does not include them. See the [NDArray Class](..//ndarray/class) page for core methods available on both classes.
</Note>

***

## Arithmetic methods

### add

```typescript theme={null}
add(other: NDArray | number): NDArray
```

Element-wise addition. See [add](..//math/arithmetic).

### subtract

```typescript theme={null}
subtract(other: NDArray | number): NDArray
```

Element-wise subtraction. See [subtract](..//math/arithmetic).

### multiply

```typescript theme={null}
multiply(other: NDArray | number): NDArray
```

Element-wise multiplication. See [multiply](..//math/arithmetic).

### divide

```typescript theme={null}
divide(other: NDArray | number): NDArray
```

Element-wise division. See [divide](..//math/arithmetic).

### floor\_divide

```typescript theme={null}
floor_divide(other: NDArray | number): NDArray
```

Element-wise floor division. See [floor\_divide](..//math/arithmetic).

### mod

```typescript theme={null}
mod(other: NDArray | number): NDArray
```

Element-wise modulo. See [mod](..//math/arithmetic).

### remainder

```typescript theme={null}
remainder(divisor: NDArray | number): NDArray
```

Element-wise remainder (same as `mod`). See [remainder](..//math/arithmetic).

### fmod

```typescript theme={null}
fmod(divisor: NDArray | number): NDArray
```

Element-wise C-style remainder. See [fmod](..//math/arithmetic).

### power

```typescript theme={null}
power(exponent: NDArray | number): NDArray
```

Raise elements to the given power. See [power](..//math/arithmetic).

### negative

```typescript theme={null}
negative(): NDArray
```

Element-wise numerical negation (`-x`). See [negative](..//math/arithmetic).

### positive

```typescript theme={null}
positive(): NDArray
```

Element-wise numerical positive (`+x`). Returns a copy. See [positive](..//math/arithmetic).

### absolute

```typescript theme={null}
absolute(): NDArray
```

Element-wise absolute value. See [absolute](..//math/arithmetic).

### reciprocal

```typescript theme={null}
reciprocal(): NDArray
```

Element-wise reciprocal (`1/x`). See [reciprocal](..//math/arithmetic).

### square

```typescript theme={null}
square(): NDArray
```

Element-wise square (`x**2`). See [square](..//math/arithmetic).

### sqrt

```typescript theme={null}
sqrt(): NDArray
```

Element-wise square root. See [sqrt](..//math/arithmetic).

### cbrt

```typescript theme={null}
cbrt(): NDArray
```

Element-wise cube root. See [cbrt](..//math/arithmetic).

### fabs

```typescript theme={null}
fabs(): NDArray
```

Element-wise absolute value (always returns float). See [fabs](..//math/arithmetic).

### sign

```typescript theme={null}
sign(): NDArray
```

Element-wise sign indication (-1, 0, or 1). See [sign](..//math/arithmetic).

### heaviside

```typescript theme={null}
heaviside(x2: NDArray | number): NDArray
```

Heaviside step function. See [heaviside](..//math/arithmetic).

### divmod

```typescript theme={null}
divmod(divisor: NDArray | number): [NDArray, NDArray]
```

Returns both floor quotient and remainder. See [divmod](..//math/arithmetic).

***

## Exponential and logarithmic methods

### exp

```typescript theme={null}
exp(): NDArray
```

Natural exponential (`e^x`). See [exp](..//math/exponential).

### exp2

```typescript theme={null}
exp2(): NDArray
```

Base-2 exponential (`2^x`). See [exp2](..//math/exponential).

### expm1

```typescript theme={null}
expm1(): NDArray
```

`e^x - 1`, accurate for small x. See [expm1](..//math/exponential).

### log

```typescript theme={null}
log(): NDArray
```

Natural logarithm. See [log](..//math/exponential).

### log2

```typescript theme={null}
log2(): NDArray
```

Base-2 logarithm. See [log2](..//math/exponential).

### log10

```typescript theme={null}
log10(): NDArray
```

Base-10 logarithm. See [log10](..//math/exponential).

### log1p

```typescript theme={null}
log1p(): NDArray
```

`ln(1 + x)`, accurate for small x. See [log1p](..//math/exponential).

### logaddexp

```typescript theme={null}
logaddexp(x2: NDArray | number): NDArray
```

`log(exp(x1) + exp(x2))`, numerically stable. See [logaddexp](..//math/exponential).

### logaddexp2

```typescript theme={null}
logaddexp2(x2: NDArray | number): NDArray
```

`log2(2^x1 + 2^x2)`, numerically stable. See [logaddexp2](..//math/exponential).

***

## Trigonometric methods

### sin

```typescript theme={null}
sin(): NDArray
```

Sine (radians). See [sin](..//math/trigonometric).

### cos

```typescript theme={null}
cos(): NDArray
```

Cosine (radians). See [cos](..//math/trigonometric).

### tan

```typescript theme={null}
tan(): NDArray
```

Tangent (radians). See [tan](..//math/trigonometric).

### arcsin

```typescript theme={null}
arcsin(): NDArray
```

Inverse sine. See [arcsin](..//math/trigonometric).

### arccos

```typescript theme={null}
arccos(): NDArray
```

Inverse cosine. See [arccos](..//math/trigonometric).

### arctan

```typescript theme={null}
arctan(): NDArray
```

Inverse tangent. See [arctan](..//math/trigonometric).

### arctan2

```typescript theme={null}
arctan2(other: NDArray | number): NDArray
```

Element-wise arc tangent of `this/other`, choosing the correct quadrant. See [arctan2](..//math/trigonometric).

### hypot

```typescript theme={null}
hypot(other: NDArray | number): NDArray
```

Hypotenuse given two right-triangle legs. See [hypot](..//math/trigonometric).

### degrees

```typescript theme={null}
degrees(): NDArray
```

Convert radians to degrees. See [degrees](..//math/trigonometric).

### radians

```typescript theme={null}
radians(): NDArray
```

Convert degrees to radians. See [radians](..//math/trigonometric).

***

## Hyperbolic methods

### sinh

```typescript theme={null}
sinh(): NDArray
```

Hyperbolic sine. See [sinh](..//math/hyperbolic).

### cosh

```typescript theme={null}
cosh(): NDArray
```

Hyperbolic cosine. See [cosh](..//math/hyperbolic).

### tanh

```typescript theme={null}
tanh(): NDArray
```

Hyperbolic tangent. See [tanh](..//math/hyperbolic).

### arcsinh

```typescript theme={null}
arcsinh(): NDArray
```

Inverse hyperbolic sine. See [arcsinh](..//math/hyperbolic).

### arccosh

```typescript theme={null}
arccosh(): NDArray
```

Inverse hyperbolic cosine. See [arccosh](..//math/hyperbolic).

### arctanh

```typescript theme={null}
arctanh(): NDArray
```

Inverse hyperbolic tangent. See [arctanh](..//math/hyperbolic).

***

## Rounding methods

### ceil

```typescript theme={null}
ceil(): NDArray
```

Ceiling of each element. See [ceil](..//math/rounding).

### floor

```typescript theme={null}
floor(): NDArray
```

Floor of each element. See [floor](..//math/rounding).

### fix

```typescript theme={null}
fix(): NDArray
```

Round towards zero. See [fix](..//math/rounding).

### rint

```typescript theme={null}
rint(): NDArray
```

Round to nearest integer. See [rint](..//math/rounding).

### trunc

```typescript theme={null}
trunc(): NDArray
```

Truncate to integer part. See [trunc](..//math/rounding).

### around

```typescript theme={null}
around(decimals?: number): NDArray
```

Round to the given number of decimals (default: 0). See [around](..//math/rounding).

### round

```typescript theme={null}
round(decimals?: number): NDArray
```

Alias for `around`. See [around](..//math/rounding).

### clip

```typescript theme={null}
clip(a_min: number | NDArray | null, a_max: number | NDArray | null): NDArray
```

Clip values to `[a_min, a_max]`. Pass `null` for no bound on either side. See [clip](..//math/other-math).

***

## Comparison methods

### equal

```typescript theme={null}
equal(other: NDArray | number): NDArray
```

Element-wise equality. Returns boolean array. See [equal](..//logic/comparison).

### not\_equal

```typescript theme={null}
not_equal(other: NDArray | number): NDArray
```

Element-wise inequality. Returns boolean array. See [not\_equal](..//logic/comparison).

### greater

```typescript theme={null}
greater(other: NDArray | number): NDArray
```

Element-wise greater than. Returns boolean array. See [greater](..//logic/comparison).

### greater\_equal

```typescript theme={null}
greater_equal(other: NDArray | number): NDArray
```

Element-wise greater than or equal. Returns boolean array. See [greater\_equal](..//logic/comparison).

### less

```typescript theme={null}
less(other: NDArray | number): NDArray
```

Element-wise less than. Returns boolean array. See [less](..//logic/comparison).

### less\_equal

```typescript theme={null}
less_equal(other: NDArray | number): NDArray
```

Element-wise less than or equal. Returns boolean array. See [less\_equal](..//logic/comparison).

### allclose

```typescript theme={null}
allclose(other: NDArray | number, rtol?: number, atol?: number): boolean
```

Returns `true` if all elements are equal within tolerance. Default `rtol=1e-5`, `atol=1e-8`. See [allclose](..//logic/comparison).

### isclose

```typescript theme={null}
isclose(other: NDArray | number, rtol?: number, atol?: number): NDArray
```

Element-wise comparison within tolerance. Returns boolean array. See [isclose](..//logic/comparison).

### isnan

```typescript theme={null}
isnan(): NDArray
```

Test element-wise for NaN. Returns boolean array. See [isnan](..//logic/comparison).

### isinf

```typescript theme={null}
isinf(): NDArray
```

Test element-wise for infinity. Returns boolean array. See [isinf](..//logic/comparison).

### isfinite

```typescript theme={null}
isfinite(): NDArray
```

Test element-wise for finiteness. Returns boolean array. See [isfinite](..//logic/comparison).

### isnat

```typescript theme={null}
isnat(): NDArray
```

Test element-wise for NaT (Not a Time). Always returns `false` (no datetime support). See [isnat](..//logic/comparison).

***

## Logic methods

### logical\_and

```typescript theme={null}
logical_and(other: NDArray | number): NDArray
```

Element-wise logical AND. Returns boolean array. See [logical\_and](..//logic/logical-ops).

### logical\_or

```typescript theme={null}
logical_or(other: NDArray | number): NDArray
```

Element-wise logical OR. Returns boolean array. See [logical\_or](..//logic/logical-ops).

### logical\_not

```typescript theme={null}
logical_not(): NDArray
```

Element-wise logical NOT. Returns boolean array. See [logical\_not](..//logic/logical-ops).

### logical\_xor

```typescript theme={null}
logical_xor(other: NDArray | number): NDArray
```

Element-wise logical XOR. Returns boolean array. See [logical\_xor](..//logic/logical-ops).

### invert

```typescript theme={null}
invert(): NDArray
```

Bitwise NOT (alias for `bitwise_not`). See [invert](..//bitwise/bitwise-ops).

### bitwise\_and

```typescript theme={null}
bitwise_and(other: NDArray | number): NDArray
```

Element-wise bitwise AND. Requires integer dtype. See [bitwise\_and](..//bitwise/bitwise-ops).

### bitwise\_or

```typescript theme={null}
bitwise_or(other: NDArray | number): NDArray
```

Element-wise bitwise OR. Requires integer dtype. See [bitwise\_or](..//bitwise/bitwise-ops).

### bitwise\_xor

```typescript theme={null}
bitwise_xor(other: NDArray | number): NDArray
```

Element-wise bitwise XOR. Requires integer dtype. See [bitwise\_xor](..//bitwise/bitwise-ops).

### bitwise\_not

```typescript theme={null}
bitwise_not(): NDArray
```

Element-wise bitwise NOT. Requires integer dtype. See [bitwise\_not](..//bitwise/bitwise-ops).

### left\_shift

```typescript theme={null}
left_shift(shift: NDArray | number): NDArray
```

Element-wise left bit shift. See [left\_shift](..//bitwise/bitwise-ops).

### right\_shift

```typescript theme={null}
right_shift(shift: NDArray | number): NDArray
```

Element-wise right bit shift. See [right\_shift](..//bitwise/bitwise-ops).

### copysign

```typescript theme={null}
copysign(x2: NDArray | number): NDArray
```

Change the sign of `this` to that of `x2`, element-wise. See [copysign](..//logic/logical-ops).

### signbit

```typescript theme={null}
signbit(): NDArray
```

Returns `true` where the sign bit is set (negative). See [signbit](..//logic/logical-ops).

### nextafter

```typescript theme={null}
nextafter(x2: NDArray | number): NDArray
```

Return the next floating-point value after `this` towards `x2`. See [nextafter](..//logic/logical-ops).

### spacing

```typescript theme={null}
spacing(): NDArray
```

Return the distance between each element and the nearest adjacent number. See [spacing](..//logic/logical-ops).

***

## Reduction methods

### sum

```typescript theme={null}
sum(axis?: number, keepdims?: boolean): NDArray | number | bigint | Complex
```

Sum of elements along an axis. Returns a scalar when axis is `undefined`. See [sum](..//reductions/basic).

### prod

```typescript theme={null}
prod(axis?: number, keepdims?: boolean): NDArray | number | bigint | Complex
```

Product of elements along an axis. See [prod](..//reductions/basic).

### mean

```typescript theme={null}
mean(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Arithmetic mean along an axis. See [mean](..//reductions/basic).

### std

```typescript theme={null}
std(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number
```

Standard deviation along an axis. `ddof` defaults to 0. See [std](..//reductions/statistics).

### var

```typescript theme={null}
var(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number
```

Variance along an axis. `ddof` defaults to 0. See [var](..//reductions/statistics).

### min

```typescript theme={null}
min(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Minimum value along an axis. See [min](..//reductions/basic).

### max

```typescript theme={null}
max(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Maximum value along an axis. See [max](..//reductions/basic).

### argmin

```typescript theme={null}
argmin(axis?: number): NDArray | number
```

Index of the minimum value along an axis. See [argmin](..//reductions/basic).

### argmax

```typescript theme={null}
argmax(axis?: number): NDArray | number
```

Index of the maximum value along an axis. See [argmax](..//reductions/basic).

### all

```typescript theme={null}
all(axis?: number, keepdims?: boolean): NDArray | boolean
```

Test whether all elements evaluate to `true`. See [all](..//reductions/basic).

### any

```typescript theme={null}
any(axis?: number, keepdims?: boolean): NDArray | boolean
```

Test whether any element evaluates to `true`. See [any](..//reductions/basic).

### ptp

```typescript theme={null}
ptp(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Peak-to-peak (maximum minus minimum) along an axis. See [ptp](..//reductions/basic).

### median

```typescript theme={null}
median(axis?: number, keepdims?: boolean): NDArray | number
```

Median along an axis. See [median](..//reductions/statistics).

### percentile

```typescript theme={null}
percentile(q: number, axis?: number, keepdims?: boolean): NDArray | number
```

Compute the q-th percentile (0--100). See [percentile](..//reductions/statistics).

### quantile

```typescript theme={null}
quantile(q: number, axis?: number, keepdims?: boolean): NDArray | number
```

Compute the q-th quantile (0--1). See [quantile](..//reductions/statistics).

### average

```typescript theme={null}
average(weights?: NDArray, axis?: number): NDArray | number | Complex
```

Weighted average along an axis. See [average](..//reductions/statistics).

### cumsum

```typescript theme={null}
cumsum(axis?: number): NDArray
```

Cumulative sum along an axis. See [cumsum](..//reductions/basic).

### cumprod

```typescript theme={null}
cumprod(axis?: number): NDArray
```

Cumulative product along an axis. See [cumprod](..//reductions/basic).

### diff

```typescript theme={null}
diff(n?: number, axis?: number): NDArray
```

Calculate the n-th discrete difference along an axis. See [diff](..//reductions/basic).

### nansum

```typescript theme={null}
nansum(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Sum treating NaNs as zero. See [nansum](..//reductions/basic).

### nanprod

```typescript theme={null}
nanprod(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Product treating NaNs as one. See [nanprod](..//reductions/basic).

### nanmean

```typescript theme={null}
nanmean(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Mean ignoring NaNs. See [nanmean](..//reductions/basic).

### nanstd

```typescript theme={null}
nanstd(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number
```

Standard deviation ignoring NaNs. See [nanstd](..//reductions/statistics).

### nanvar

```typescript theme={null}
nanvar(axis?: number, ddof?: number, keepdims?: boolean): NDArray | number
```

Variance ignoring NaNs. See [nanvar](..//reductions/statistics).

### nanmin

```typescript theme={null}
nanmin(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Minimum ignoring NaNs. See [nanmin](..//reductions/basic).

### nanmax

```typescript theme={null}
nanmax(axis?: number, keepdims?: boolean): NDArray | number | Complex
```

Maximum ignoring NaNs. See [nanmax](..//reductions/basic).

### nanargmin

```typescript theme={null}
nanargmin(axis?: number): NDArray | number
```

Index of minimum ignoring NaNs. See [nanargmin](..//reductions/basic).

### nanargmax

```typescript theme={null}
nanargmax(axis?: number): NDArray | number
```

Index of maximum ignoring NaNs. See [nanargmax](..//reductions/basic).

### nanmedian

```typescript theme={null}
nanmedian(axis?: number, keepdims?: boolean): NDArray | number
```

Median ignoring NaNs. See [nanmedian](..//reductions/statistics).

### nancumsum

```typescript theme={null}
nancumsum(axis?: number): NDArray
```

Cumulative sum treating NaNs as zero. See [nancumsum](..//reductions/basic).

### nancumprod

```typescript theme={null}
nancumprod(axis?: number): NDArray
```

Cumulative product treating NaNs as one. See [nancumprod](..//reductions/basic).

### nanpercentile

```typescript theme={null}
nanpercentile(q: number, axis?: number, keepdims?: boolean): NDArray | number
```

Percentile ignoring NaNs. See [nanpercentile](..//reductions/statistics).

### nanquantile

```typescript theme={null}
nanquantile(q: number, axis?: number, keepdims?: boolean): NDArray | number
```

Quantile ignoring NaNs. See [nanquantile](..//reductions/statistics).

***

## Shape methods

### reshape

```typescript theme={null}
reshape(...shape: number[]): NDArray
```

Return a new array with the given shape. Use `-1` for one inferred dimension. See [reshape](..//manipulation/shape).

### flatten

```typescript theme={null}
flatten(): NDArray
```

Return a flattened copy (always 1D). See [flatten](..//manipulation/shape).

### ravel

```typescript theme={null}
ravel(): NDArray
```

Return a flattened array. Returns a view when possible, otherwise a copy. See [ravel](..//manipulation/shape).

### squeeze

```typescript theme={null}
squeeze(axis?: number): NDArray
```

Remove axes of length one. See [squeeze](..//manipulation/shape).

### expand\_dims

```typescript theme={null}
expand_dims(axis: number): NDArray
```

Insert a new axis of length one at the given position. See [expand\_dims](..//manipulation/shape).

### transpose

```typescript theme={null}
transpose(axes?: number[]): NDArray
```

Permute the dimensions. With no arguments, reverses all axes. See [transpose](..//manipulation/shape).

### swapaxes

```typescript theme={null}
swapaxes(axis1: number, axis2: number): NDArray
```

Interchange two axes. See [swapaxes](..//manipulation/shape).

### moveaxis

```typescript theme={null}
moveaxis(source: number | number[], destination: number | number[]): NDArray
```

Move axes to new positions. See [moveaxis](..//manipulation/shape).

### T

```typescript theme={null}
get T(): NDArray
```

Transpose property (no parentheses). Returns a view with reversed axes. See [NDArray Class](..//ndarray/class#t).

***

## Linear algebra methods

### dot

```typescript theme={null}
dot(other: NDArray): NDArray | number | bigint | Complex
```

Dot product following NumPy semantics (inner product for 1D, matrix multiply for 2D). See [dot](..//linalg/products).

### matmul

```typescript theme={null}
matmul(other: NDArray): NDArray
```

Matrix multiplication (`@` operator equivalent). See [matmul](..//linalg/products).

### inner

```typescript theme={null}
inner(other: NDArray): NDArray | number | bigint | Complex
```

Inner product (contracts over last axes of both arrays). See [inner](..//linalg/products).

### outer

```typescript theme={null}
outer(other: NDArray): NDArray
```

Outer product (flattens inputs, computes `a[i] * b[j]`). See [outer](..//linalg/products).

### tensordot

```typescript theme={null}
tensordot(other: NDArray, axes?: number | [number[], number[]]): NDArray | number | bigint | Complex
```

Tensor dot product along specified axes. Default contracts 2 axes. See [tensordot](..//linalg/products).

### trace

```typescript theme={null}
trace(): number | bigint | Complex
```

Sum of diagonal elements. See [trace](..//linalg/products).

### diagonal

```typescript theme={null}
diagonal(offset?: number, axis1?: number, axis2?: number): NDArray
```

Return specified diagonals. See [diagonal](..//linalg/products).

***

## Sorting and searching methods

### sort

```typescript theme={null}
sort(axis?: number): NDArray
```

Return a sorted copy. Default sorts along the last axis. See [sort](..//sorting/sort).

### argsort

```typescript theme={null}
argsort(axis?: number): NDArray
```

Return indices that would sort the array. See [argsort](..//sorting/sort).

### partition

```typescript theme={null}
partition(kth: number, axis?: number): NDArray
```

Partially sort so that the element at `kth` position is in its final sorted position. See [partition](..//sorting/sort).

### argpartition

```typescript theme={null}
argpartition(kth: number, axis?: number): NDArray
```

Return indices that would partition the array. See [argpartition](..//sorting/sort).

### searchsorted

```typescript theme={null}
searchsorted(v: NDArray, side?: 'left' | 'right'): NDArray
```

Find indices where elements should be inserted to maintain order. See [searchsorted](..//sorting/search).

### nonzero

```typescript theme={null}
nonzero(): NDArray[]
```

Return indices of non-zero elements, one array per dimension. See [nonzero](..//sorting/search).

### argwhere

```typescript theme={null}
argwhere(): NDArray
```

Find indices of non-zero elements, returned as a 2D array of shape `(N, ndim)`. See [argwhere](..//sorting/search).

***

## Indexing methods

### take

```typescript theme={null}
take(indices: ArrayLike, axis?: number): NDArray
```

Take elements along an axis. `indices` accepts NDArrays of any rank, nested `number[]`/`number[][]`/`number[][][]`, or a scalar; the output preserves the shape of `indices` (a scalar index reduces rank by one). See [take](..//indexing/advanced-indexing).

### put

```typescript theme={null}
put(indices: number[], values: NDArray | number | bigint): void
```

Set values at flat indices (in-place). See [put](..//indexing/advanced-indexing).

### choose

```typescript theme={null}
choose(choices: NDArray[]): NDArray
```

Construct an array by choosing from a list of arrays using `this` as the index. See [choose](..//indexing/advanced-indexing).

### compress

```typescript theme={null}
compress(condition: NDArray | boolean[], axis?: number): NDArray
```

Return selected slices along an axis where `condition` is `true`. See [compress](..//indexing/advanced-indexing).

### repeat

```typescript theme={null}
repeat(repeats: number | number[], axis?: number): NDArray
```

Repeat elements of the array. See [repeat](..//manipulation/shape).

### resize

```typescript theme={null}
resize(newShape: number[]): NDArray
```

Return a new array with the given shape. Repeats data if the new shape is larger. See [resize](..//manipulation/shape).

### bindex

```typescript theme={null}
bindex(mask: NDArray, axis?: number): NDArray
```

Boolean array indexing. Select elements where `mask` is `true`. See [compress](..//indexing/advanced-indexing).

### iindex

```typescript theme={null}
iindex(indices: NDArray | number[] | number[][], axis?: number): NDArray
```

Integer array indexing (fancy indexing). Select elements by an array of indices. See [take](..//indexing/advanced-indexing).

***

## Complex number methods

### conj

```typescript theme={null}
conj(): NDArray
```

Return the complex conjugate, element-wise. For real arrays, returns a copy. See [conj](..//math/other-math).

### conjugate

```typescript theme={null}
conjugate(): NDArray
```

Alias for `conj`. See [conj](..//math/other-math).

***

## Other methods

### copy

```typescript theme={null}
copy(): NDArray
```

Return a deep copy. See [NDArray Class](..//ndarray/class#copy).

### astype

```typescript theme={null}
astype(dtype: DType, copy?: boolean): NDArray
```

Cast to a new dtype. See [NDArray Class](..//ndarray/class#astype).

### fill

```typescript theme={null}
fill(value: number | bigint): void
```

Fill array in-place with a scalar. See [NDArray Class](..//ndarray/class#fill).

### toArray

```typescript theme={null}
toArray(): NestedArray
```

Convert to nested JavaScript array. See [NDArray Class](..//ndarray/class#toarray).

### tolist

```typescript theme={null}
tolist(): NestedArray
```

Same as `toArray`. See [NDArray Class](..//ndarray/class#tolist).

### tobytes

```typescript theme={null}
tobytes(): ArrayBuffer
```

Serialize to raw bytes. See [NDArray Class](..//ndarray/class#tobytes).

### get

```typescript theme={null}
get(indices: number[]): number | bigint | Complex
```

Get element by multi-dimensional indices. See [NDArray Class](..//ndarray/class#get).

### set

```typescript theme={null}
set(indices: number[], value: number | bigint | Complex): void
```

Set element by multi-dimensional indices. See [NDArray Class](..//ndarray/class#set).

### slice

```typescript theme={null}
slice(...sliceStrs: string[]): NDArray
```

NumPy-style string slicing. See [NDArray Class](..//ndarray/class#slice).

### row

```typescript theme={null}
row(i: number): NDArray
```

Get row `i`. See [NDArray Class](..//ndarray/class#row).

### col

```typescript theme={null}
col(j: number): NDArray
```

Get column `j`. See [NDArray Class](..//ndarray/class#col).

### rows

```typescript theme={null}
rows(start: number, stop: number): NDArray
```

Get a range of rows. See [NDArray Class](..//ndarray/class#rows).

### cols

```typescript theme={null}
cols(start: number, stop: number): NDArray
```

Get a range of columns. See [NDArray Class](..//ndarray/class#cols).

### item

```typescript theme={null}
item(...args: number[]): number | bigint | Complex
```

Extract a scalar value. See [NDArray Class](..//ndarray/class#item).
