MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Best way to save data in notebooks

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82051] Re: [mg82004] Re: Best way to save data in notebooks
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Wed, 10 Oct 2007 04:32:13 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com

Some of the delay is the transfer of the data over the link, and you're not
going to avoid that.  But you can deal with any delay in displaying the result 
by doing something like this...

With[{x = Compress[data]}, 
 Interpretation["<<Compressed Data>>", Uncompress[x]]]

Note...it doesn't matter what the first argument of Interpretation is, as this 
merely defines the appearance.

Sincerely,
 
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.

On Tue, 9 Oct 2007 05:37:22 -0400 (EDT), Yaroslav Bulatov wrote:
> Thanks for the tips. "Compress" helps, but it can still take a long
> time for the FrontEnd to render the output cell. Is it possible to
> tell Mathematica to collapse the output cell without displaying it?
>
> On Oct 7, 9:01 pm, AES <sieg... at stanford.edu> wrote:
>> In article <fea47j$i2... at smc.vnet.net>, John Fultz <jfu... at wolfram.com>
>> wrote:
>>
>>
>>>> I'd like to have "data" saved in the notebook, so that when I open
>>>> it,
>>>> I can replot the data. My current solution is to copy and paste the
>>>> data manually into a separate mathematica cell (ie,
>>>> data={1,2,3...}),
>>>> but that causes the front-end to freeze when largedatafile.csv is
>>>> too
>>>> large.
>>>>
>>>> Yaroslav
>>>>
>>> Assuming you're using version 6, you could get a compressed form by
>>> doing...
>>>
>>> Compress[data]
>>>
>>> ...then modify the output cell by putting the caret at the beginning
>>> and
>>> typing
>>>
>>> data=Uncompress@
>>>
>>> which will convert the Output cell into an Input cell you can
>>> evaluate in the
>>> future.  It's not quite as fast and convenient as DumpSave, of
>>> course, but if
>>> you really insist on keeping the data in the notebook, it'll work.
>>>
>> John,
>>
>> Thanks very much.  This is one of those very useful tricks that might be
>> difficult for an ordinary user to develop by himself, but can be
>> understood and used once you've seen it.
>>
>> As an extension to it:  Suppose the data in question is not necessarily
>> a Plot, maybe just a List; said List is the Output cell created by
>> executing an Input cell; and each time one executes said Input cell one
>> wants to save the new result **and not erase any of the old ones** that
>> may still be sitting there -- except of course one doesn't want to go
>> too far in doing this if the List is large, and one will want to delete
>> selected older Saved Lists from time to time.
>>
>> I think I can actually figure out a procedure that can do this task by
>> myself (maybe add a random name or date to the List name each time you
>> Save one?).  But of course if someone more skilled than me wanted to lay
>> out a template for doing this, I'd be delighted to use it instead.




  • Prev by Date: Re: DynamicModule, Speed, and locally static variables.
  • Next by Date: Re: What is the purpose of the Defer Command?
  • Previous by thread: Re: Best way to save data in notebooks
  • Next by thread: issue generating table of random numbers