Message Boards Message Boards

Import rounding CSV data to 3 places

Posted 10 years ago
I'm importing a CSV file to do some data work, but the imported data is either rounded to three digits.  For example,

Imported data
time
-75.1
-25.1
-5.53
7.43
17.9
65.7
123
558
767
1130
1240

CSV data file
time
-75.1245
-25.152345
-5.535432
7.4323456
17.92345
65.75423
123.5234
558.6534
767.6547
1134.2346
1242.23456

How can I get the data in full or control the rounding?  I'm importing simply as shown below.
allData = Import["C:\\data.csv"];

Thanks in advance.
POSTED BY: Greg Cmarik
2 Replies
Please run the function InputForm on allData:
InputForm[allData]

Mathematica often stores numbers at a higher precision than it displays them. This helps to keep things readable in many situations. 
POSTED BY: Sean Clarke
Posted 10 years ago
Thanks for the reply Sean.

According to that check, the data is as I posted the first time, rounded to three digits.  It could be due to how Excel is saving the data.  I just checked in notepad and found everything is in sci notation (rounded to... hundredths place).  Even though Excel can re-open the file and I can see all the original decimal places, it appears other programs are not equally able.  Time to do some guessing.
POSTED BY: Greg Cmarik
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