Just to be clear, this all works perfectly in v8.0.4.0. It only fails me in v9.0. I use 64-bit Linux, 64-bit versions of Mathematica, and I have 16GB of RAM.
I have a data file formatted as follows:
Date,Open,High,Low,Close,Volume,OpenInt
19700102,1.6047,1.6140,1.6047,1.6140,881445,0
19700105,1.6140,1.6235,1.6047,1.6235,549208,0
19700106,1.6140,1.6140,1.6047,1.6140,508527,0
19700107,1.6140,1.6424,1.6140,1.6424,752620,0
There are 10839 rows of data in the file. I store the first col of data in a list called "dataDate", the second col of data in "dataOpen", etc... All works great until I try to print the data back to the screen. Version 8 displays the data as expected; but version 9 borks, the kernel resets, and all function definitions and data structures are reset.
Here's the updated, simple code:
data = Import["pg.us.txt", "Data"];
(* Read the first row of data, to get the column headings *)
dataColumnHeadings = data[[1, All]]
(* Store each column of data in a separate list, removing the first element with Rest[] *)
dataDate = Rest[data[[All, 1]]];
dataOpen = Rest[data[[All, 2]]];
dataHigh = Rest[data[[All, 3]]];
dataLow = Rest[data[[All, 4]]];
dataClose = Rest[data[[All, 5]]];
dataVolume = Rest[data[[All, 6]]];
dataOpenInt = Rest[data[[All, 7]]];
Length[dataDate]
Length[dataOpen]
Length[dataHigh]
Length[dataLow]
Length[dataClose]
Length[dataVolume]
Length[dataOpenInt]
Now, if I try to display the contents of any of the seven lists, (by simply typing the list's name and evaluating it), it works perfectly in version 8. But in version 9, any attempt to evaluate a list by evaluation of its name causes Mathematica 9 to bork: all imported data is lost as all variables are undefined, user-defined functions cleared, etc. (blue text instead of black text). It takes about 6-7 seconds for the error to occur, after you evaluate the list name and it displays the truncated output.
Here are links to my updated test notebook and data file if anyone would be kind enough to see if this is just a problem with my machine, or a bug:
https://dl.dropbox.com/u/1224415/test_case.nb
https://dl.dropbox.com/u/1224415/pg.us.txt
Thanks
UPDATE: As I stated in a response below, removing the "Rest[]" function, used to remove the first element of each list, seems to fix the problem. Perhaps I'll try to remove the first element in some other manner; or perhaps try to use "Rest[]" in a three step process (wasting RAM):
dataDate = data[[All, 1]];
dataDate2 = Rest[dataDate];
Clear[dataDate];
UPDATE 2: It doesn't matter how much I mess with the list data: as soon as I use the "Rest[]" command on it, and display the results to screen, the program borks. I'm calling this a bug and contacting Wolfram. This is what I get for being an early adopter...


Ifif it makes no difference and keep theRestif it does.)? Please also try to paste the exact same code you post here back into a notebook and evaluate it that way. Since people can't seem to reproduce the problem, it'll help if you post code that can be pasted and evaluated without modification (you could start withdata = Import["https://dl.dropbox.com/u/1224415/pg.us.txt", "Data"]). – Szabolcs Dec 14 '12 at 0:57datalook like? What aboutdata[[All, 1]]? What aboutRest[data[[All, 1]]]? – Szabolcs Dec 14 '12 at 1:01data[[All,1]]look like for you? Can you post it (shortened)? What doesDeveloper`PackedArrayQ[data[[All,1]]]give? What if you dox = data[[All,1]]thenRest[x]? What aboutdata[[2;;, 1]]? The question still makes it vry difficult for us to see what is going wrong there. – Szabolcs Dec 14 '12 at 3:54bugstag before the community could reproduce and confirm the problem. No one so far managed to and you didn't provide enough information for us to see what is going on. – Szabolcs Dec 14 '12 at 3:58