I want to compare elements in a list that looks like this
{{{4, 1}}, {{1, 2}}, {{1, 3}}, {{2, 4}}, {{2, 5}}, {{2, 6}}, {{1,
7}}, {{4, 8}}, {{1, 9}}, {{4, 10}}, {{2, 11}}, {{4, 12}}, {{4,
13}}, {{2, 14}}, {{2, 15}}, {{1, 16}}, {{4, 17}}, {{2, 18}}, {{2,
19}}, {{1, 20}}, {{1, 21}}, {{4, 22}}, {{4, 23}}, {{1, 24}}, {{2,
25}}, {{1, 26}}, {{4, 27}}, {{4, 28}}, {{4, 29}}, {{4, 30}},.....
I want to select the smalest (first) number b in the pair {a,b} where a will be greater than 4.
Cases[data, {{a_, b_}} /; a > 4 :> b, 1, 1]
? But none of the entries in your list meet the criterion (alla
are less than or equal to4
). $\endgroup$ – Michael E2 May 26 '18 at 16:47