arkouda.scipy.sparsematrix¶
Functions¶
|
Create a sparse matrix from three pdarrays representing the row indices, |
|
Create a random sparse matrix with the specified number of rows and columns |
|
Multiply two sparse matrices. |
Module Contents¶
- arkouda.scipy.sparsematrix.create_sparse_matrix(size: int, rows: pdarray, cols: pdarray, vals: pdarray, layout: str) sparray[source]¶
Create a sparse matrix from three pdarrays representing the row indices, column indices, and values of the non-zero elements of the matrix.
- arkouda.scipy.sparsematrix.random_sparse_matrix(size: int, density: float, layout: str, dtype: type | str = numpy.int64) sparray[source]¶
Create a random sparse matrix with the specified number of rows and columns and the specified density. The density is the fraction of non-zero elements in the matrix. The non-zero elements are uniformly distributed random numbers in the range [0,1).
- Parameters:
- Returns:
A sparse matrix with the specified number of rows and columns and the specified density
- Return type:
- Raises:
ValueError – Raised if density is not in the range [0,1]