Message Boards Message Boards

Manage large data quantity?

Posted 4 years ago

I have a very large quantity of information in a CVS file. I imported the data correctly but now I need to use FromDigits... and everytime that that I try the function, the Mathematica collapses and closes... any suggestions?

POSTED BY: Eddy Rey
6 Replies
Posted 4 years ago

What version of Mathematica are you using? What is the goal of the FromDigits? It's very unclear from the notebook. Can you take a smaller piece of your data and show what outputs you are expecting from that data?

POSTED BY: Sean Cheren
Posted 4 years ago

Mathematica 12.0.

The goal is to convert the data in a integer...

POSTED BY: Eddy Rey

Please provide a short example of relevant input and desired output. As indicated in a different response, it is not obvious what exactly is desired here.

POSTED BY: Daniel Lichtblau
Anonymous User
Anonymous User
Posted 4 years ago

You may have an error in your CSV.

Remember to read instructions on Import: you are importing Mathematica expressions. If you wish to "import only data" then insure you use the right options.

(ie, if you import 2+2 to Mathematica the default is to evaluate it as an expression not as "2+2" text, and if you import "123 promise lane" Mathematica will believe that's 123promiselane unless your sure the Import you used is "data only not expression").

FromDigits "can't" cause a collapse and cause a close (used in a script without error). Perhaps you used the wrong syntax (it is possible to cause the Kernel to Quit[] using illegal syntax, though the front end should not be effected unless you have an OS bug), or imported the data incorrectly (my guess is you imported expressions un-knowingly and because you don't realize they are expressions that constitute bad syntax, you haven't guessed why it would be "closing out" on you).

POSTED BY: Anonymous User
Posted 4 years ago

Log[cross] is unevaluated because cross contains the string "cross_section" from the header row. Try

cross = alist[[2 ;;, 2]];
logC = Log[cross]

As others have commented, it is not clear what you are trying to accomplish with FromDigits since your data does not have a list of digits.

POSTED BY: Rohit Namjoshi

I don't see any problem with plotting or loading this data. Indeed the first line is a string instead of a number and many numbers of which you want to take the Log are 0 but in general mathematica doesn't realy care about that at all.

In[88]:= alist = Import["CO2_IR_50.csv", "Data"];

In[102]:= cross = alist[[All, 2]];

logC = Log[cross];

logC[[1 ;; 10]]

Out[104]= {Log[
  "cross_section"], Indeterminate, Indeterminate, Indeterminate, \
Indeterminate, Indeterminate, Indeterminate, Indeterminate, \
Indeterminate, Indeterminate}

Even plotting work ok, it just ignores values it cannot plot.

ListPlot[data]
ListPlot[Transpose[{alist[[All, 1]], logC}]]

enter image description here

PS use a semicolon at the end of your lines to prevent mathematica printing everything to the notebook when it is not needed.

POSTED BY: Martijn Froeling
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract