Return the indices and values of the nonzero elements of a matrix
A : dense or sparse matrix
Matrix whose nonzero elements are desired.
(I,J,V) : tuple of arrays
I,J, and V contain the row indices, column indices, and values of the nonzero matrix entries.
scipy.sparse.eye
scipy.sparse.hstack
Enter search terms or a module, class or function name.