SciPy csc CSR What the hell is this thing?

Source: Internet
Author: User

Alas, the scipy and Theano of the CSC matrix and CSR matrix in the sparse matrix on the internet are too few, have, and only use, and do not explain how the matrix was generated. Reference Example:
>>> data = Np.asarray ([7, 8, 9]) >>> indices = Np.asarray ([0, 1, 2]) >>> indptr = Np.asarray ([0, 2, 3, 3]) >>> m = Sp.csc_matrix (data, indices, indptr), Shape= (3, 3)) >>> print M.toarray () [[7 0 0] [8 0 0] [0 9 0]]

This inside indices is good to say, is not 0 data 7,8,9 This three number in the matrix row number, that inptr is what ghost thing, its all spell is index pointer array. Do not know what to do at all, the end of the original is this, we also take the above example as an example:

Data:7 8 9

indices:0 1 2

Indptr:0 2 3 3

That means 7 and 8 are 0 columns, 9 are 1 columns. 7 on 0 Columns 0 rows, 8 on 0 columns 1 rows, 9 in 1 columns 2 rows, the remaining elements are all 0, thus forming a

[7 0 0] [8 0 0] [0 9 0]]
In fact, this is from Csparse, there is a better example of this: Csparse

If we are not clear about this, I have been a victim of the people are willing to provide more answers.




SciPy csc CSR What the hell is this thing?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.