lenskit.data.matrix.CSRStructure#

class lenskit.data.matrix.CSRStructure#

Bases: NamedTuple

Representation of the compressed sparse row structure of a sparse matrix, without any data values.

Stability:
Caller (see Stability Levels).
rowptrs: numpy.ndarray#
colinds: numpy.ndarray#
shape: tuple[int, int]#
property nrows#
property ncols#
property nnz#
property row_nnzs: lenskit.data.types.NPVector[numpy.int32]#

Array of row sizes (number of nonzeros in each row).

Return type:

lenskit.data.types.NPVector[numpy.int32]

extent(row)#
Parameters:

row (int)

Return type:

tuple[int, int]

row_cs(row)#
Parameters:

row (int)

Return type:

numpy.ndarray