scipy.sparse.lil_diags

scipy.sparse.lil_diags(diags, offsets, (m, n), dtype='d')

Generate a lil_matrix with the given diagonals.

Parameters:

diags : list of list of values e.g. [[1,2,3],[4,5]]

values to be placed on each indicated diagonal.

offsets : list of ints

diagonal offsets. This indicates the diagonal on which the given values should be placed.

(r,c) : tuple of ints

row and column dimensions of the output.

dtype : dtype

output data-type.

Previous topic

scipy.sparse.lil_eye

Next topic

scipy.sparse.spdiags

This Page

Quick search