点击运行
import numpy as np from scipy.sparse import csr_matrix arr = np.array([0, 0, 0, 0, 0, 1, 1, 0, 2]) print(csr_matrix(arr))
运行结果 :
正在执行...