ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 27 Feb 2011 10:37:40 -0600Notebook List Object Data Storage/Retrieval? (Start/Restart)http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/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)?Wed, 18 Aug 2010 16:07:18 -0500http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/Answer by William Stein for <p>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)?</p>
http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?answer=11389#post-id-11389Use 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]
Wed, 18 Aug 2010 16:16:07 -0500http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?answer=11389#post-id-11389Comment by ccanonc for <p>Use the save and load commands to store arbitrary data. This is in the Sage notebook:</p>
<pre><code>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]
</code></pre>
http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?comment=23090#post-id-23090Is 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.) ThanksWed, 18 Aug 2010 16:48:00 -0500http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?comment=23090#post-id-23090Comment by ccanonc for <p>Use the save and load commands to store arbitrary data. This is in the Sage notebook:</p>
<pre><code>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]
</code></pre>
http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?comment=22827#post-id-22827I'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?Fri, 27 Aug 2010 08:59:22 -0500http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?comment=22827#post-id-22827Answer by v_2e for <p>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)?</p>
http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?answer=11835#post-id-11835 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.Wed, 08 Dec 2010 06:21:49 -0600http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?answer=11835#post-id-11835Comment by Simon for <p>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:</p>
<ul>
<li>To have an ability to upload this list containing the results of computations to my local Sage server.</li>
<li>To have an ability to work with this list using other programs.</li>
</ul>
<p>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:</p>
<pre><code>x1 y1
x2 y2
x3 y3
...
xn yn
</code></pre>
<p>How can I do that?
Thanks.</p>
http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?comment=22048#post-id-22048You should probably ask that as a separate question...Sun, 27 Feb 2011 10:37:40 -0600http://ask.sagemath.org/question/7558/notebook-list-object-data-storageretrieval-startrestart/?comment=22048#post-id-22048