arkouda.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.sparsematrix.create_sparse_matrix(size: int, rows: arkouda.pdarrayclass.pdarray, cols: arkouda.pdarrayclass.pdarray, vals: arkouda.pdarrayclass.pdarray, layout: str) arkouda.sparrayclass.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.sparsematrix.random_sparse_matrix(size: int, density: float, layout: str, dtype: type | str = int64) arkouda.sparrayclass.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]
- arkouda.sparsematrix.sparse_matrix_matrix_mult(A, B: arkouda.sparrayclass.sparray) arkouda.sparrayclass.sparray [source]¶
Multiply two sparse matrices.