Skip to main content

frombuffer

Interpret a buffer as a 1-D array.
Returns: NDArray — 1-D array created from the buffer data.

fromfile

Create an array from data in a file. This function requires Node.js file system access.
Returns: NDArray — 1-D array created from file data.
fromfile requires Node.js. It will throw an error in browser environments. Use numpy-ts/node for file I/O support.

fromfunction

Construct an array by executing a function over each coordinate. The function is called with N arguments (one per dimension) for each element, where each argument is the index along that dimension.
Returns: NDArray — Array of the given shape, with each element set to func(i, j, ...).

fromiter

Create a 1-D array from an iterable.
Returns: NDArray — 1-D array from the iterable values.

fromstring

Create a 1-D array from a string of numbers.
Returns: NDArray — 1-D array parsed from the string.

meshgrid

Return coordinate matrices from coordinate vectors. Given N 1-D arrays, meshgrid returns N N-D arrays for vectorized evaluations of N-D scalar fields.
Returns: NDArray[] — Array of N-D coordinate arrays, one per input.