full_like

sparse.full_like(a, fill_value, dtype=None)[source]

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

Parameters:
  • a (array_like) – The shape and data-type of the result will match those of a.
  • dtype (data-type, optional) – Overrides the data type of the result.
Returns:

out – Array of fill_value with the same shape and type as a.

Return type:

COO

Examples

>>> x = np.ones((2, 3), dtype='i8')
>>> full_like(x, 9.0).todense()  # doctest: +NORMALIZE_WHITESPACE
array([[9, 9, 9],
       [9, 9, 9]])