### Navigation

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

# scipy.sparse.rand

`scipy.sparse.``rand`(m, n, density=0.01, format='coo', dtype=None)

  Generate a sparse matrix of the given shape and density with uniformely distributed values.

  Parameters : | m, n : int shape of the matrix density : real density of the generated matrix: density equal to one means a full matrix, density of 0 means a matrix with no non-zero items. format : str sparse matrix format. dtype : dtype type of the returned matrix values.

  Notes

  Only float types are supported for now.

### Navigation

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