full
Return a SparseArray of given shape and type, filled with fill_value
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape
|
int or tuple of ints
|
Shape of the new array, e.g., |
required |
fill_value
|
scalar
|
Fill value. |
required |
dtype
|
data - type
|
The desired data-type for the array. The default, |
None
|
format
|
str
|
A format string. |
'coo'
|
compressed_axes
|
iterable
|
The axes to compress if returning a GCXS array. |
required |
order
|
(C, None)
|
Values except these are not currently supported and raise a NotImplementedError. |
'C'
|
Returns:
Name | Type | Description |
---|---|---|
out |
SparseArray
|
Array of |
Examples:
>>> full(5, 9).todense()
array([9, 9, 9, 9, 9])
>>> full((2, 2), 9, dtype=float).todense()
array([[9., 9.],
[9., 9.]])
Source code in sparse/numba_backend/_common.py
1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 |
|