Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import a file into mathematica and reference a column by header name

I have a TSV file with many columns like so;

genename    X1  X100    X103    X105    X115    X117    X120    X122    X123         
Gene20728   0.415049    0.517868    0.820183    0.578081    0.30997 0.395181

I would like to import it into Mathematica, and then extract and sort a column.

i.e., I want to extract column ["X117"] and sort it, and output the sorted list.

like image 278
Tom Avatar asked Jan 23 '23 11:01

Tom


1 Answers

table = Import["file.csv", "Table"];
x117 = Drop[table[[All, 7]], 1];
sorted = Sort[x117];
like image 74
ragfield Avatar answered May 10 '23 03:05

ragfield