I have a CSV file with 5 columns and about 2*104 rows that I need to visualise.
I’ve imported the file like so:
data = Import["res.csv", "CSV"];`
Now, I’m going to want to generate a lot of visuals from this – all 5 dimensions on a single plot as well as various cross sections.
My questions:
If I want to select, say columns 1, 4 and 5 from my data and feed them to ListPlot3D how would I do that?
And, values in columns can be grouped. So if I wanted to ListPlot3D colums 1, 2, 4 and 5, but I want to group columns 1 and 2 on the same axis, how would I tell Mathematica to do that?
Thanks.
I hate to disagree with a fellow poster especially after it has been accepted, but the
Transposeis unnecessary. Almost everything you’re asking for can be done within the context ofPart:Since matrices are stored row-wise within Mathematica,
[[All, {1, 4, 5}]]can be read[[rows, columns]]. More specifically,Allindicates here that you want all rows, but you can specify specific rows as well. Another construct that may be of interest isSpanwhich is used to specify groups of indices, and if your CSV file contains a header row, you can strip it from your data usingAs to your second requirement, to use both columns 1 and 2 as the x coordinate, then it is simply
and you change
Allto2;;if you wish to strip off the header row.