bsparse.zeros#
- zeros(bshape, dtype=<class 'float'>, sizes=None, symmetry=None, format='bcoo')#
Create an empty sparse matrix of specified bshape and dtype.
- Parameters:
- bshapetuple[int, int]
The bshape 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:
- BSparse
An empty sparse matrix of specified bshape and dtype.
Examples
>>> bdia = zeros((3,3), format="bdia") >>> bdia BDIA(bshape=(3, 3), bnnz=0 | shape=(3, 3), nnz=0) >>> bdia[0, 0] COO(shape=(1, 1), nnz=0, dtype=float64)