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
1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 |
|