3
$\begingroup$

I had a large table of data that I exported, and then when it had completed, I exported it to a file. (Just in the form Export["filename.dat", data], no specified format.). When I imported it later, I was confused by how much of it was 0's. Opening up the table, I saw the following chunks of data:

0.000999315368 0.00103971193 ... 0.001184 0.00112 0.00116 ... 0.0008 0.0007 0.e-3 ... 0. 0.e1 0.e1 0.e1 0.e2

Can anyone explain what this 0.e-3 format means? Why did my data export this way? The original was entirely nonzero.

$\endgroup$
  • $\begingroup$ Please post a snippet of the data, so that we can try to reproduce the behavior. $\endgroup$ – Jason B. Aug 24 '15 at 7:00
  • $\begingroup$ I will if/when I can, but it was the result of a very long computation that will take a while to reproduce (a day or so of running; 12GB of RAM usage). Similar calculations with different parameters hadn't caused this behavior, either, so I wouldn't know how to get a minimal example case. I'll have to re-run the calculation anyway to get the data, so at that point I can post it here. Until then, I was hoping someone knew what sorts of values could produce the above output. $\endgroup$ – Alex Meiburg Aug 24 '15 at 7:05
  • $\begingroup$ I can't at first glance reproduce 0.e-3 or similar. I suspect it has to do with some floating point precision issues. In general, x.yyy e z (spaces inserted for clarity) means x.yyy*10^z. Exporting a number like 0.00000005 would result in 5.e-8 though. As for Import issues, it may help to specify the format of the data being imported, e.g. Import["filename.dat", "Table"] $\endgroup$ – LLlAMnYP Aug 24 '15 at 10:05
  • $\begingroup$ use .m format to preserve exact precision $\endgroup$ – george2079 Aug 24 '15 at 11:52
  • $\begingroup$ Ah, thank you! :) That might come in handy. I've decided I'll just redo everything with 3 times the precision value, now. :P $\endgroup$ – Alex Meiburg Aug 24 '15 at 12:11
3
$\begingroup$

It turned out to be, as LLIAMNnYP suggested, a precision issue. The data I had contained values such as (in FullForm)

List[0``2.7745530926768973,0.0012428756482861055723647403237208664`0.33865082835168153,0``3.1320806025128776,0``3.1262338523773163,0.00272972783712194166621690533274311041`0.3781937081269392,0.00079422012197691538097255940529751282`1.0511881767729303,0``2.9372865212434487,0``2.5786797291683388,0``3.4913067025680555,0``3.4050525516996344,0``1.7137742939876988,0``3.210012647512957,0.00099100731685927050465534371426201687`0.03446455280318874,0.00107842029005569529455873228047266261`0.9198460804579403,0.00028526377555515141379652299669089643`0.06306105024607492,0``2.643792350067955,0``1.336393802620609,0``1.4768850172897074,0``2.91781013108647,0``3.1781825229994505,0.00186446416359446377421552474072804984`0.9610361487083864,0``2.743632616359945]`

where -- today I learned! -- the numbers after the double-backticks indicate uncertainty in the value. When it has this much uncertainty, the number itself renders as 0.*10^-4, etc. When exported these became 0.eN, when imported these were just a normal 0.0.

$\endgroup$
  • $\begingroup$ Always +1 for self-answers $\endgroup$ – LLlAMnYP Aug 24 '15 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.