Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Save asarray


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Save asarray
Date   Fri, 17 Jan 2014 19:29:12 -0500

Dear All,

I am interested in preserving an associative array between Stata sessions.

There does not seem to be a command that would save/load the whole
array as one binary object into a file, or I've failed to find one.

The array object itself appears to be a pointer, and thus can't be
saved as a matrix.

I can save an associative array by getting the list of all keys, then
looping through all the keys, getting their values and saving
key-value pairs. Restoring then is reading all the key-value pairs
sequentially and posting to the new array. Is there a faster/more
efficient way of doing this?

I am also interested in the limits of associative arrays (e.g. storing
~10mln keys of type: "2014_01_17_100_075_XYZ" and values of type
double). I am fine if it takes ~300mb in size, but will it be working
ok? (in my actual experiment the memory grew very fast and I had to
abort the experiment when >4GB where allocated and swapping became
intolerable.)

Thank you,
    Sergiy Radyakin
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index