Create CSR matrix from x_index, y_index, value
问题 I have data of the format (x_index, y_index, value) and I'm trying to create a CSR matrix using scipy (scipy.sparse.csr.csr_matrix). For example, convert: 0 0 10 0 1 5 1 0 3 1 1 4 To the following: 10 5 3 4 I've read the documentation here: http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html However I'm still not clear which of the examples applies to my use case. 回答1: If you can separate the input data into a sequence of row indices, a sequence of column indices