larray.full_like

larray.full_like(array, fill_value, title=None, dtype=None, order='K', meta=None) Array[source]

Return an array with the same axes and type as input array and filled with fill_value.

Parameters
arrayArray

Input array.

fill_valuescalar or Array

Value to fill the array

titlestr, optional

Deprecated. See ‘meta’ below.

dtypedata-type, optional

Overrides the data type of the result. Defaults to the data type of array.

order{‘C’, ‘F’, ‘A’, or ‘K’}, optional

Overrides the memory layout of the result. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ (default) means match the layout of a as closely as possible.

metalist of pairs or dict or Metadata, optional

Metadata (title, description, author, creation_date, …) associated with the array. Keys must be strings. Values must be of type string, int, float, date, time or datetime.

Returns
Array

Examples

>>> a = ndtest((2, 3))
>>> full_like(a, 5)
a\b  b0  b1  b2
 a0   5   5   5
 a1   5   5   5