bsparse.eye#
- eye(bshape, offset=0, dtype=<class 'float'>, format='bcoo')#
Create a sparse identity matrix of specified bshape and dtype.
- Parameters:
- bshapetuple[int, int]
The bshape of the matrix.
- offsetint, optional
The offset of the diagonal, by default 0.
- dtypenp.dtype, optional
The data type of the matrix elements, by default float.
- formatstr, optional
The sparse format of the matrix, by default “coo”.
- Returns:
- BSparse
A sparse identity matrix of specified bshape and dtype.
Examples
>>> eye((3,3)) BCOO(bshape=(3, 3), bnnz=3 | shape=(3, 3), nnz=3)