dask.array.empty_like

dask.array.empty_like(a, dtype=None, order='C', chunks=None, name=None, shape=None)[source]

Return a new array with the same shape and type as a given array.

Parameters
aarray_like

The shape and data-type of a define these same attributes of the returned array.

dtypedata-type, optional

Overrides the data type of the result.

order{‘C’, ‘F’}, optional

Whether to store multidimensional data in C- or Fortran-contiguous (row- or column-wise) order in memory.

chunkssequence of ints

The number of samples on each block. Note that the last block will have fewer samples if len(array) % chunks != 0.

namestr, optional

An optional keyname for the array. Defaults to hashing the input keyword arguments.

shapeint or sequence of ints, optional.

Overrides the shape of the result.

Returns
outndarray

Array of uninitialized (arbitrary) data with the same shape and type as a.

See also

ones_like

Return an array of ones with shape and type of input.

zeros_like

Return an array of zeros with shape and type of input.

empty

Return a new uninitialized array.

ones

Return a new array setting values to one.

zeros

Return a new array setting values to zero.

Notes

This function does not initialize the returned array; to do that use zeros_like or ones_like instead. It may be marginally faster than the functions that do set the array values.