Global

Members

(constant) DTYPE_MAP

Description:
  • The TypedArray map

Source:

The TypedArray map

Methods

arange(start, stop, stepopt, dtypeopt) → {NDArray}

Description:
  • Like Python's arange: [start, stop)

Source:
Parameters:
Name Type Attributes Default Description
start number

the starting value of the sequence.

stop number | null

the end value of the sequence.

step number | null <optional>
1

the spacing between values.

dtype string <optional>
'float64'

the data type of the resulting array.

Returns:
Type
NDArray

array(source, dtypeopt) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Attributes Default Description
source Array | TypedArray

The source data.

dtype string <optional>
'float64'

The desired data type.

Returns:
Type
NDArray

concat(arrays, axisopt) → {NDArray}

Description:
  • Joins a sequence of arrays along an existing axis.

Source:
Parameters:
Name Type Attributes Default Description
arrays Array.<NDArray>

The arrays must have the same shape, except in the dimension corresponding to axis.

axis number <optional>
0

The axis along which the arrays will be joined.

Returns:

A new NDArray.

Type
NDArray

eye(n, mopt, dtypeopt) → {NDArray}

Description:
  • Creates a 2D identity matrix.

Source:
Parameters:
Name Type Attributes Default Description
n number

Number of rows.

m number <optional>

Number of columns. Defaults to n if not provided.

dtype string <optional>
'float64'

Data type of the array.

Returns:

A 2D NDArray with ones on the main diagonal.

Type
NDArray

float32(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

float64(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

fromWasm(bridge, shape, dtypeopt) → {NDArray}

Description:
  • Static factory: Creates a new NDArray directly from WASM computation results.

Source:
Parameters:
Name Type Attributes Description
bridge WasmBuffer

The WasmBuffer instance containing the result from WASM.

shape Array.<number>

The shape of the new NDArray.

dtype string <optional>

The data type of the new NDArray. If not provided, uses bridge.dtype.

Returns:

The new NDArray.

Type
NDArray

full(shape, value, dtypeopt) → {NDArray}

Description:
  • Creates a new NDArray of the given shape, filled with a specified value.

Source:
Parameters:
Name Type Attributes Default Description
shape Array.<number>

The shape of the new array.

value *

The value to fill the array with.

dtype string <optional>
'float64'

The data type of the new array.

Returns:
Type
NDArray

int16(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

int32(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

int8(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

linspace(start, stop, numopt, dtypeopt) → {NDArray}

Description:
  • Linearly spaced points.

Source:
Parameters:
Name Type Attributes Default Description
start number

the starting value of the sequence.

stop number | null

the end value of the sequence.

num number <optional>
50

the number of samples to generate.

dtype string <optional>
'float64'

the data type of the resulting array.

Returns:
Type
NDArray

ones(shape, dtypeopt) → {NDArray}

Description:
  • Creates a new NDArray of the given shape, filled with ones.

Source:
Parameters:
Name Type Attributes Default Description
shape Array.<number>

The shape of the new array.

dtype string <optional>
'float64'

The data type of the new array.

Returns:
Type
NDArray

stack(arrays, axisopt) → {NDArray}

Description:
  • Joins a sequence of arrays along a new axis. The stack function creates a new dimension, whereas concat joins along an existing one. All input arrays must have the same shape and dtype.

Source:
Parameters:
Name Type Attributes Default Description
arrays Array.<NDArray>

The list of arrays to stack.

axis number <optional>
0

The axis in the result array along which the input arrays are stacked.

Returns:

A new NDArray.

Type
NDArray

uint16(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

uint32(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

uint8(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

uint8c(source) → {NDArray}

Description:
  • Creates an NDArray from a regular array or TypedArray.

Source:
Parameters:
Name Type Description
source Array | TypedArray

The source data.

Returns:
Type
NDArray

where(condition, x, y) → {NDArray}

Description:
  • where(condition, x, y) Returns a new array with elements chosen from x or y depending on condition. Supports NumPy-style broadcasting across all three arguments, including 0-sized dimensions.

Source:
Parameters:
Name Type Description
condition NDArray | Array | number

Where True, yield x, otherwise yield y.

x NDArray | Array | number

Values from which to choose if condition is True.

y NDArray | Array | number

Values from which to choose if condition is False.

Returns:

A new contiguous NDArray.

Type
NDArray

zeros(shape, dtypeopt) → {NDArray}

Description:
  • Creates a new NDArray of the given shape, filled with zeros.

Source:
Parameters:
Name Type Attributes Default Description
shape Array.<number>

The shape of the new array.

dtype string <optional>
'float64'

The data type of the new array.

Returns:
Type
NDArray