zeros_like
Return a SparseArray of zeros with the same shape and type as a
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
array_like
|
The shape and data-type of the result will match those of |
required |
dtype
|
data - type
|
Overrides the data type of the result. |
None
|
format
|
str
|
A format string. |
None
|
compressed_axes
|
iterable
|
The axes to compress if returning a GCXS array. |
required |
Returns:
Name | Type | Description |
---|---|---|
out |
SparseArray
|
Array of zeros with the same shape and type as |
Examples:
>>> x = np.ones((2, 3), dtype="i8")
>>> zeros_like(x).todense()
array([[0, 0, 0],
[0, 0, 0]])
Source code in sparse/numba_backend/_common.py
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 |
|