scipy.sparse Matrix

From GM-RKB
Jump to navigation Jump to search

A scipy.sparse Matrix is a sparse matrix data structure that is a scipy Data Structure.

  • Context:
  • Example(s):
    • from scipy.sparse import csr_matrix, issparse, isspmatrix, isspmatrix_csc, isspmatrix_csr, isspmatrix_bsr, isspmatrix_lil, isspmatrix_dok, isspmatrix_coo, isspmatrix_dia ;
      import numpy as np ;
      sprsRowMatrix = sparse.csr_matrix(np.array([[1,2,0], [0,0,3], [1,0,4]])) ;
      from scipy import int8 ;
      sprsRowMatrixInt8 = csr_matrix(sprsRowMatrix, dtype=int8) ;
  • Counter-Example(s):
  • See: sklearn.


References

2013