I really couldn't google it. How to transform sparse matrix to ndarray?
Assume, I have sparse matrix t of zeros. Then
g = t.todense()
g[:10]
matrix([[0],
[0],
[0],
[0],
[0],
[0],
[0],
[0],
[0],
[0]])
instead of [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Solution:
t.toarray().flatten()
.toarray()instead...