> docs =, ] > indptr = > indices = > data = > vocabulary = > for d in docs. Slow column slicing operations (consider CSC)Ĭhanges to the sparsity structure are expensive (consider LIL or DOK) Advantages of the CSR formatĮfficient arithmetic operations CSR + CSR, CSR * CSR, etc. Sparse matrices can be used in arithmetic operations: they supportĪddition, subtraction, multiplication, division, and matrix power. If the shape parameter is not supplied, the matrix dimensions Row i are stored in indices:indptr] and theirĬorresponding values are stored in data:indptr]. Is the standard CSR representation where the column indices for Where data, row_ind and col_ind satisfy the To construct an empty matrix with shape (M, N)ĭtype is optional, defaulting to dtype=’d’. With another sparse matrix S (equivalent to S.tocsr()) csr_matrix((M, N), ) With a dense matrix or rank-2 ndarray D csr_matrix(S) csr_matrix ( arg1, shape = None, dtype = None, copy = False ) ¶Ĭompressed Sparse Row matrix This can be instantiated in several ways: csr_matrix(D) Statistical functions for masked arrays ( K-means clustering and vector quantization (
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |