(1)ndarray 与 scipy.sparse.csr.csr_matrix 的互转 import numpy as npfrom scipy import sparse 1.1 ndarry 转 csr_matrix A = np.array([[1,2,0],[0,0,3],[1,0,4]]) array([[1, 2, 0], [0, 0, 3], [1, 0, 4]]) sA = sparse.csr_matrix(A) # Here's the initialization of…