+ 7
Python
how can we represent a sparse matrix in an efficent manner using dictionary data type....? how would we compare this with the representation of matrix using list data type?... what approches will be efficent for large sprase matrix?
4 Answers
+ 2
http://interactivepython.org/courselib/static/thinkcspy/Dictionaries/Sparsematrices.html
You can read this , Jayasanka and everyone with this problem...
hope this was helpful..:)
+ 6
I know that numpy is very efficient when it comes to vectors and matrices, in case it helps.
+ 3
var m = {1, 2, 3
4, 5, 6,
7, 8, 9}
that's how I think it is done
0
What about this?
{i:v
for i,v in enumerate(
[{i:x for x in range(3)} for
i in range(3)
]}
The result is a nested dict