### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.9 Reference Guide (DRAFT) »
- Sparse matrices (`scipy.sparse`) »

# scipy.sparse.construct

Functions to construct sparse matrices

Functions

`bmat`(blocks[, format, dtype]) | Build a sparse matrix from sparse sub-blocks
`eye`(m, n[, k, dtype, format]) | eye(m, n) returns a sparse (m x n) matrix where the k-th diagonal
`hstack`(blocks[, format, dtype]) | Stack sparse matrices horizontally (column wise)
`identity`(n[, dtype, format]) | Identity matrix in sparse format
`kron`(A, B[, format]) | kronecker product of sparse matrices A and B
`kronsum`(A, B[, format]) | kronecker sum of sparse matrices A and B
`rand`(m, n[, density, format, dtype]) | Generate a sparse matrix of the given shape and density with uniformely distributed values.
`spdiags`(data, diags, m, n[, format]) | Return a sparse matrix from diagonals.
`upcast`(*args) | Returns the nearest supported sparse dtype for the combination of one or more types.
`vstack`(blocks[, format, dtype]) | Stack sparse matrices vertically (row wise)
`warn`(message[, category, stacklevel]) | Issue a warning, or maybe ignore it or raise an exception.

Classes

`bsr_matrix`(arg1[, shape, dtype, copy, blocksize]) | Block Sparse Row matrix
`coo_matrix`(arg1[, shape, dtype, copy]) | A sparse matrix in COOrdinate format.
`csc_matrix`(arg1[, shape, dtype, copy]) | Compressed Sparse Column matrix
`csr_matrix`(arg1[, shape, dtype, copy]) | Compressed Sparse Row matrix
`dia_matrix`(arg1[, shape, dtype, copy]) | Sparse matrix with DIAgonal storage
`lil_matrix`(arg1[, shape, dtype, copy]) | Row-based linked list sparse matrix

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- SciPy v0.9 Reference Guide (DRAFT) »
- Sparse matrices (`scipy.sparse`) »