scipy.sparse.
block_array#Build a sparse array from sparse sub-blocks
Grid of sparse arrays with compatible shapes. An entry of None implies an all-zero array.
The sparse format of the result (e.g. âcsrâ). By default an appropriate sparse array format is returned. This choice is subject to change.
The data-type of the output array. If not given, the dtype is determined from that of blocks.
See also
block_diag
specify blocks along the main diagonals
diags
specify (possibly offset) diagonals
Examples
>>> from scipy.sparse import coo_array, block_array >>> A = coo_array([[1, 2], [3, 4]]) >>> B = coo_array([[5], [6]]) >>> C = coo_array([[7]]) >>> block_array([[A, B], [None, C]]).toarray() array([[1, 2, 5], [3, 4, 6], [0, 0, 7]])
>>> block_array([[A, None], [None, C]]).toarray() array([[1, 2, 0], [3, 4, 0], [0, 0, 7]])
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4