full_like
Return a full array with the same shape and type as a given array.
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 |
Examples:
>>> x = np.ones((2, 3), dtype="i8")
>>> full_like(x, 9.0).todense()
array([[9, 9, 9],
[9, 9, 9]])
Source code in sparse/numba_backend/_common.py
1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 | |