In scipy, we can construct a sparse matrix using scipy.sparse.lil_matrix() etc. But the matrix is in 2d.
I am wondering if there is an existing data structure for sp
Have a look at sparray - sparse n-dimensional arrays in Python (by Jan Erik Solem). Also available on github.