apply_along_axis
Apply a function to 1-D slices of an array along the given axis. The function is called once for each slice, and the results are assembled into an output array. Supports arrays of any dimensionality. For ND arrays, the function iterates over all combinations of indices on dimensions other thanaxis. Any trailing arguments are forwarded to each invocation of func1d, matching NumPy’s np.apply_along_axis(func1d, axis, arr, *args). Existing 3-argument calls behave identically.
Returns:
NDArray — The result of applying func1d along the specified axis.
apply_over_axes
Apply a function repeatedly over multiple axes. After each application, the result is kept with the reduced axis preserved as a size-1 dimension, so subsequent axes remain valid.
Returns:
NDArray — The result of applying func over all specified axes.
shares_memory
Determine whether two arrays share the same underlying data buffer. Returnstrue only when the arrays definitely reference overlapping memory.
Returns:
boolean — true if both arrays share memory.
may_share_memory
Determine whether two arrays might share memory. This is a less strict check thanshares_memory — it may return true even when the arrays do not actually overlap, but it never returns false when they do.
Returns:
boolean — true if the arrays might share memory.
ndim
Return the number of dimensions of an array.
Returns:
number — The number of dimensions (axes).
shape
Return the shape of an array as a number array.
Returns:
number[] — The dimensions of the array.
size
Return the total number of elements in an array.
Returns:
number — The total number of elements (product of shape dimensions).
geterr
Get the current error handling settings for floating-point operations.object — An object with keys divide, over, under, and invalid, each set to one of 'warn', 'raise', 'ignore', or 'print'.
seterr
Set how floating-point errors are handled. Returns the previous settings so you can restore them later.
Returns:
FloatErrorState — The previous error handling settings.
item
Get a single scalar element from an array.tolist
Convert an array to nested JavaScript arrays (or a scalar for 0-D arrays).tobytes
Return the raw bytes of an array in C-order by default.byteswap
Swap the byte order of each array element.view
Create a view of an array (same dtype view currently supported).tofile
Write an array to a file (Node.js-oriented API; see note in implementation for environment limits).fill
Fill an array in place with a scalar value.configureWasm
Set the size of the WASM linear memory before it is allocated. RaisemaxMemory when a workload exhausts the heap, or lower it in memory-constrained environments such as a serverless runtime.
Returns:
void
wasmFreeBytes
Report how many bytes remain available in the WASM heap. Useful for spotting a leak in a long-running process, or for sizing a batch before allocating it.number — Free bytes in the WASM heap. Initializes the heap if it has not been allocated yet, so calling this counts as first use for the purposes of configureWasm.