dask.array.Array.astype — Dask documentation (original) (raw)

dask.array.Array.astype

Array.astype(dtype, **kwargs)[source]

Copy of the array, cast to a specified type.

Parameters

dtypestr or dtype

Typecode or data-type to which the array is cast.

casting{‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional

Controls what kind of data casting may occur. Defaults to ‘unsafe’ for backwards compatibility.

copybool, optional

By default, astype always returns a newly allocated array. If this is set to False and the dtype requirement is satisfied, the input array is returned instead of a copy.

Note

Dask does not respect the contiguous memory layout of the array, and will ignore the order keyword argument. The default order is ‘C’ contiguous.