We have the following list
data = {{1,2,3,4,5}, {6,7,8,9,10}, {11,12,13,-1,14}}
If I want to create a new list containing the first and the fourth elements of the first list we use
data2 = data[[All, {1, 4}]];
Now, what if I want the first and the Log10() of the fourth element? Log10(-1) does not exist so in the new list there should be only two sublists.
Any ideas?
Cases[data[[All, {1, 4}]], {_?Positive, _?Positive}]
help you along? $\endgroup$ – MarcoB Oct 20 '15 at 16:33Cases[data[[All, {1, 4}]], {x_, y_} :> {x, Log[10, y]} /; y > 0]
$\endgroup$ – Dr. belisarius Oct 20 '15 at 16:37