3
$\begingroup$

I am importing a large csv data file into Mathematica for analysis. The problem is that Mathematica insists on displaying all 2500 rows of data. This is only a small subset of a much larger project. Can I just read the file in and display the header like python and pandas. The reason I'm using Mathematica is that I need the Nonlinear Curve Fitting capability.

rbraw = Import["https://raw.githubusercontent.com/benhowe75/rubidium_hyperfine_414/\master/simple.csv", "Table"]
$\endgroup$
  • 2
    $\begingroup$ If you do something like rbraw = Import[(* stuff *)]; (note the semicolon!), the output is suppressed. You can then use things like Short[] or Shallow[] to look at an elided version of the data. $\endgroup$ – J. M.'s technical difficulties May 6 at 1:11
  • 1
    $\begingroup$ Or Import["https://raw.githubusercontent.com/benhowe75/rubidium_ hyperfine_414/master/simple.csv", "Dataset", HeaderLines -> 1] $\endgroup$ – Rohit Namjoshi May 6 at 1:58
4
$\begingroup$

Nice spectrum.

rbraw = Import["https://raw.githubusercontent.com/benhowe75/rubidium_hyperfine_414/master/simple.csv",
          "Dataset",
          HeaderLines -> 1];

rbraw[Map[Reverse]][ListPlot[#, PlotRange -> All, ImageSize -> 500] &]

enter image description here

| improve this answer | |
$\endgroup$
5
$\begingroup$

You can work like this: import the data, ending the Import expression with a semicolon so to not display the entire table.

rbraw = 
  Import["https://raw.githubusercontent.com/benhowe75/rubidium_hyperfine_414/\master/simple.csv", "Dataset", 
  HeaderLines -> 1];

Then you can use the name of the dataset and specify the elements you want to display with the command. rbraw[1;;10]. This will show the first ten values of the table, the same concept is used for more or less values.

enter image description here

| improve this answer | |
$\endgroup$

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.