larray.ones_like

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

Return an array with the same axes as array and filled with ones.

Parameters
arrayArray

Input array.

titlestr, optional

Deprecated. See ‘meta’ below.

dtypedata-type, optional

Overrides the data type of the result.

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))
>>> ones_like(a)
a\b  b0  b1  b2
 a0   1   1   1
 a1   1   1   1