# Global

##

### Members

#### (constant) DTYPE_MAP

Description:

  - The TypedArray map

Source:
  - ndarray_core.js, line 20

The TypedArray map

### Methods

#### arange(start, stop, step, dtype)

Description:

  - Like Python's arange: [start, stop)

Source:
  - ndarray_factory.js, line 181

##### Parameters:

Name | Type | Description
--- | --- | ---
`start` | number |
`stop` | number | null |
`step` | number | null |
`dtype` | string |

#### array(source, dtypeopt) → {NDArray}

Description:

  - Creates an NDArray from a regular array or TypedArray.

Source:
  - ndarray_factory.js, line 10

##### 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:
  - ndarray_factory.js, line 354

##### 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:
  - ndarray_factory.js, line 503

##### 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:
  - ndarray_factory.js, line 77

##### 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:
  - ndarray_factory.js, line 69

##### 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:
  - ndwasm.js, line 181

##### 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:
  - ndarray_factory.js, line 168

##### 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:
  - ndarray_factory.js, line 101

##### 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:
  - ndarray_factory.js, line 93

##### 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:
  - ndarray_factory.js, line 117

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | Array | TypedArray | The source data.

##### Returns:

Type
  NDArray

#### linspace(start, stop, num, dtype) → {NDArray}

Description:

  - Linearly spaced points.

Source:
  - ndarray_factory.js, line 203

##### Parameters:

Name | Type | Description
--- | --- | ---
`start` | number |
`stop` | number | null |
`num` | number |
`dtype` | string |

##### Returns:

Type
  NDArray

#### ones(shape, dtypeopt) → {NDArray}

Description:

  - Creates a new NDArray of the given shape, filled with ones.

Source:
  - ndarray_factory.js, line 155

##### 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:
  - ndarray_factory.js, line 430

##### 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:
  - ndarray_factory.js, line 109

##### 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:
  - ndarray_factory.js, line 85

##### 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:
  - ndarray_factory.js, line 125

##### 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:
  - ndarray_factory.js, line 133

##### 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:
  - ndarray_factory.js, line 224

##### 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:
  - ndarray_factory.js, line 143

##### 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