I have numpy arrays I need to convert to DOK format. Why does this work:
x = np.asarray([1, 0, 0])
y = scipy.sparse.dok_matrix(scipy.sparse.csr_matrix(x))
But this doesn't:
x = np.asarray([1, 0, 0])
y = scipy.sparse.dok_matrix(x)
which throws the error:
"TypeError: Expected rank <=2 dense array or matrix."
I don't find anything in Scipy's docs that suggest I shouldn't be able to convert an array to a dok matrix directly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…