frombuffer
Interpret a buffer as a 1-D array.| Name | Type | Default | Description |
|---|---|---|---|
buffer | ArrayBuffer | TypedArray | - | An object that exposes the buffer interface. |
dtype | DType | 'float64' | Data type of the returned array. |
count | number | -1 | Number of items to read. -1 means all data in the buffer. |
offset | number | 0 | Start reading the buffer from this offset (in bytes for ArrayBuffer, in elements for TypedArray). |
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.| Name | Type | Default | Description |
|---|---|---|---|
_file | string | - | File path to read from. |
_dtype | DType | 'float64' | Data type of the returned array. |
_count | number | -1 | Number of items to read. -1 reads the entire file. |
_sep | string | '' | Separator between items in a text file. Empty string means binary read. |
NDArray — 1-D array created from file data.
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.| Name | Type | Default | Description |
|---|---|---|---|
func | (...args: number[]) => number | - | Function called with coordinate indices. Should return a single number. |
shape | number[] | - | Shape of the output array. |
dtype | DType | 'float64' | Data type of the output array. |
NDArray — Array of the given shape, with each element set to func(i, j, ...).
fromiter
Create a 1-D array from an iterable.| Name | Type | Default | Description |
|---|---|---|---|
iter | Iterable<number> | - | Any iterable yielding numbers (arrays, generators, sets, etc.). |
dtype | DType | 'float64' | Data type of the output array. |
count | number | -1 | Maximum number of items to read. -1 reads all items. |
NDArray — 1-D array from the iterable values.
fromstring
Create a 1-D array from a string of numbers.| Name | Type | Default | Description |
|---|---|---|---|
string | string | - | A string containing the data. |
dtype | DType | 'float64' | Data type of the output array. |
count | number | -1 | Number of items to read. -1 reads all items. |
sep | string | whitespace | Separator between values. Defaults to whitespace splitting. |
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.
| Name | Type | Default | Description |
|---|---|---|---|
...args | (ArrayLike | { indexing?: 'xy' | 'ij' })[] | - | 1-D arrays representing coordinates of a grid, optionally followed by options. |
NDArray[] — Array of N-D coordinate arrays, one per input.