0
$\begingroup$

It's been a while since I used Mathematica. Today I tried to visualize some data that I have in a text file. There are two columns, the first with integer values between 10 and 50 and the 2nd with floating point values around 0.005. The file has 100000 lines. The values are not sorted in any way.

I loaded the data with data1=Import["data_file", "Table"], and the truncated display seems to contain the right values.

Then I tried simply Histogram3d[data1], but all I get is an empty wireframe with both axes scaled 0 to 1. I also tried ListLinePlot and also simply got an empty wireframe.

I tried just reading the first 100 lines, but got the same results.

This is with Mathematica 11.0.0 on Linux.

$\endgroup$
  • 1
    $\begingroup$ try this Mean /@ data1. You should expect a pair of numbers like {30,0.005} In case you have some non-numeric junk in the file you will see. $\endgroup$ – george2079 Oct 24 '17 at 20:13
  • $\begingroup$ Mean /@ data1 gives me a large list of values $\endgroup$ – Paul Floyd Oct 24 '17 at 20:21
  • $\begingroup$ If your file is actually $100,000x2$ then Mean/@data1 should indeed produce a single list with $100,000$ entries; perhaps doing something like Mean/@data1//Dimensions might tell you what are the dimensions of the list; $\endgroup$ – user42582 Oct 24 '17 at 20:55
  • $\begingroup$ oops sorry should have been Mean/@Transpose[data1] , but I see you fixed it anyway. $\endgroup$ – george2079 Oct 24 '17 at 21:31
3
$\begingroup$

I found the problem. I was using "Table" with Import. I changed that to "CSV" and it worked.

| improve this answer | |
$\endgroup$

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