Equana

Back to NDArray Operations

to_dtype

Cast array elements to a different dtype.

Syntax

to_dtype(a: NDArray, dt: String) → r

Backends

TypeScriptnumwa

Description

Cast array elements to a different dtype.

Parameters

NameDescription
aInput array
dtTarget dtype as string (e.g. "Float32", "Int64")

Returns

New NDArray with converted elements

Examples

Try It
>> to_dtype([1, 2, 3], "Float32")