Ask Your Question
1

Notebook List Object Data Storage/Retrieval? (Start/Restart)

asked 2010-08-18 23:07:18 +0100

ccanonc gravatar image

updated 2010-08-18 23:14:57 +0100

How do you best store list data (between stopping and restarting notebook sessions) when there's too much for the notebook to handle as repr() output (when re-parsed upon re-evaluation)?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2010-08-18 23:16:07 +0100

William Stein gravatar image

Use the save and load commands to store arbitrary data. This is in the Sage notebook:

sage: v = [1..10]
sage: save(v,DATA+'v')
<<QUIT and RESTART your worksheet>>
sage: load(DATA+'v')
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
edit flag offensive delete link more

Comments

Is this the same as the Data pull-down menu in the notebook? (I tried thumbs-up already, but my karma points are only at 11 starting from 0.) Thanks

ccanonc gravatar imageccanonc ( 2010-08-18 23:48:00 +0100 )edit

I'm about to try save_session for the first time, for a computation that took many days (by design). Is save_session always better than save()? Comments?

ccanonc gravatar imageccanonc ( 2010-08-27 15:59:22 +0100 )edit
0

answered 2010-12-08 13:21:49 +0100

v_2e gravatar image

And what about saving some lists from the public Sage server locally and upload it back somehow after some time? For example, if I have made some operations and got a very long list as a result, how can I get that list to my local PC given that I have been working on some of the public Sage servers (say, sagenb.org)? The purposes of such action may be the following in my case:

  • To have an ability to upload this list containing the results of computations to my local Sage server.
  • To have an ability to work with this list using other programs.

For the last task it it usually necessary to write the list into some file using a human readable format. For example, I need to write a very long list of data into a text file in the following format:

x1    y1
x2    y2
x3    y3
...
xn    yn

How can I do that? Thanks.

edit flag offensive delete link more

Comments

You should probably ask that as a separate question...

Simon gravatar imageSimon ( 2011-02-27 17:37:40 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2010-08-18 23:07:18 +0100

Seen: 971 times

Last updated: Dec 08 '10