larray.ones_like¶
-
larray.ones_like(array, title='', dtype=None, order='K')[source]¶ Returns an array with the same axes as array and filled with ones.
Parameters: array : LArray
Input array.
title : str, optional
Title.
dtype : data-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.
Returns: LArray
Examples
>>> a = ndrange((2, 3)) >>> ones_like(a) {0}*\{1}* 0 1 2 0 1 1 1 1 1 1 1