Ask Your Question
1

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

asked 14 years ago

ccanonc gravatar image

updated 14 years ago

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)?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
4

answered 14 years ago

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]
Preview: (hide)
link

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 ( 14 years ago )

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 ( 14 years ago )
0

answered 14 years ago

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.

Preview: (hide)
link

Comments

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

Simon gravatar imageSimon ( 14 years ago )

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: 14 years ago

Seen: 1,012 times

Last updated: Dec 08 '10