Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Write matrix to text file

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


hannarosie at gmail

Jul 6, 2009, 3:57 PM

Post #1 of 3 (2059 views)
Permalink
Write matrix to text file

Hi,

I'm working with both python and matlab at the moment and I was wondering if
there is an efficient way to take a 2-D array (of 1s and 0s) in python and
write it to a text file such that matlab will be able to create a sparse
matrix from it later.

Thanks!


hannarosie at gmail

Jul 7, 2009, 10:46 AM

Post #2 of 3 (2014 views)
Permalink
Write matrix to text file [In reply to]

Hi,

I'm working with both python and matlab at the moment and I was wondering if
there is an efficient way to take a 2-D array (of 1s and 0s) in python and
write it to a text file such that matlab will be able to create a sparse
matrix from it later.

Thanks!


gagsl-py2 at yahoo

Jul 7, 2009, 5:45 PM

Post #3 of 3 (2021 views)
Permalink
Re: Write matrix to text file [In reply to]

En Tue, 07 Jul 2009 14:46:47 -0300, Hanna Michelsen <hannarosie [at] gmail>
escribió:

> I'm working with both python and matlab at the moment and I was
> wondering if
> there is an efficient way to take a 2-D array (of 1s and 0s) in python
> and
> write it to a text file such that matlab will be able to create a sparse
> matrix from it later.

Your yesterday post appeared on this list successfully.
Posting the very same text again isn't going to help - those that are
reading it now are likely the same that read it before.
If nobody replied, assume that something is wrong with the question
itself. Not the grammar, looks clear to me. Maybe the meaning: you say "a
2-D array" but you don't say what that means (a list? an array.array
object? a Numpy array?).

Consider *who* might be able to answer: someone that knows both Python and
matlab, and knows how to use a sparse matrix, and knows how to read data
from files, and knows how to generate such files from Python. The last
part is the easy part, because people here is supposed to know how to do
things in Python; but not how matlab works. So, please help people help
you: tell us what file format would be fine for matlab to read, and people
here surely will suggest the best way to write that in Python.

Reading http://www.mikeash.com/getting_answers.html may help too.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.