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
1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 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 | |