bsparse.sparse.zeros#

sparse.zeros(shape, dtype=<class 'float'>, symmetry=None, format='coo')#

Create an empty sparse matrix of specified shape and dtype.

Parameters:
shapetuple[int, int]

The shape of the matrix.

dtypenp.dtype, optional

The data type of the matrix elements, by default float.

symmetrystr, optional

The symmetry of the matrix, by default None.

formatstr, optional

The sparse format of the matrix, by default “coo”.

Returns:
Sparse

An empty sparse matrix of specified shape and dtype.

Examples

>>> zeros((3, 3))
COO(shape=(3, 3), nnz=0, dtype=float64)
>>> zeros((3, 3), format="csr")
CSR(shape=(3, 3), nnz=0, dtype=float64)