Save matrix to file

110 views
Skip to first unread message

James Tran

unread,
May 25, 2015, 11:51:27 AM5/25/15
to sy...@googlegroups.com
Dear all,
The matrix in sympy save as dictionary. I want to save a big matrix with size 30000x30000. Is there any method to save it to hard-disk driver? I tried with numpy but
it cannot work.

Thank you,

Jason Moore

unread,
May 25, 2015, 1:01:21 PM5/25/15
to sy...@googlegroups.com
If your matrix is dense and you store floats in it, for example, then your matrix will consume 7.2 gigabytes of space. Are you sure that is what you are trying to do? SymPy matrices will take up even more space than that depending on the variable type.

Can you explain what you are trying to do? There are many options for saving large data to disk but the answer depends on the situation.

If you have a lot of memory on your machine you can try to write the results of srepr() to file or even maybe pickling the matrix.

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/65675cce-dbc5-421c-a990-67b81c8b0a91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sudhanshu Mishra

unread,
May 25, 2015, 1:11:52 PM5/25/15
to sy...@googlegroups.com
Hi,

I think we can create a helper method, say save(filename, output_type) defined in Basic, which would write that object in the provided filename.

Just a thought. I don't see many use cases though, given we have IPython notebook.


Sudhanshu Mishra

Reply all
Reply to author
Forward
0 new messages