zeros_like

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

Return a COO array of zeros with the same shape and type as a.

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 zeros with the same shape and type as a.

Return type:

COO

Examples

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