Best strategy for exporting/importing big lists or tuples to human-readable files?

31 views
Skip to first unread message

geo909

unread,
Mar 6, 2014, 11:56:22 AM3/6/14
to sage-s...@googlegroups.com
Dear all,

I kindly ask for your feedback on the following.

My work involves the use of big lists that are of two kinds:
a) lists of integers
b) lists of lists of integers

The contents of those lists come from quite long computations and I need to reuse those tuples often,
so it is necessary to store those lists and retrieve them later, instead of recomputing all the elements
everytime. It would also be great if they are stored in a way such that they are human-readable; the
way I think of it, every element would be in another line, so that when I see them in my text editor, I
can see the row number next to the element, and thus know the index of the element in the list.

What do you recommend I should do for importing/exporting those lists to human-readable files? Any
particular function or format (e.g. txt, csv, etc) that I should use?

Any feedback would be greatly appreciated.

George

geo909

unread,
Mar 6, 2014, 4:19:58 PM3/6/14
to sage-s...@googlegroups.com
I finally decided to use the csv goodies of python as described here:
http://docs.python.org/2/library/csv.html

Christophe Bal

unread,
Mar 6, 2014, 4:47:22 PM3/6/14
to sage-s...@googlegroups.com
Hello,
if you want to work with long table-array, it could be useful to use numpy.


--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Georgios Tzanakis

unread,
Mar 7, 2014, 1:18:59 PM3/7/14
to sage-s...@googlegroups.com
Thanks.. In my case the csv solution is just fine, but it's good to know.


--
You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/FyoGDXJpohs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages