# Index an array with condition

I have a list like the following:

list = {{1, 11}, {2, 7}, {4, 2}, {7, 9}, {-2, 1}};


I would like to select those entries whose second elements are greater than 2, therefore the result should be:

newlist = {{1,11},{2,7},{7,9}}


I know how to doit separately with:

Select[list, #[[2]] > 2 &][[All, 1]]
Select[list, #[[2]] > 2 &][[All, 2]]


but in that way I get {1, 2, 7} and {11, 7, 9}. How could I join this two output to get: newlist = {{1,11},{2,7},{7,9}}

Try

Select[list, #[[2]] > 2 &]
(*{{1, 11}, {2, 7}, {7, 9}}*)

list = {{1, 11}, {2, 7}, {4, 2}, {7, 9}, {-2, 1}};


p = {_, a_} /; a <= 2;


Now there are many possibilities ...

DeleteCases[list, p];

list /. p :> Nothing;

Catenate @ SequenceSplit[list, {p}];

Delete[Position[list, p]] @ list;


All return

{{1, 11}, {2, 7}, {7, 9}}

list = {{1, 11}, {2, 7}, {4, 2}, {7, 9}, {-2, 1}};


Using Replace at level 1:

Replace[list, {_, b_ /; b <= 2} :> Nothing, {1}]

(*{{1, 11}, {2, 7}, {7, 9}}*)


Or using Pick:

Pick[#, Map[#[[2]] > 2 &]@#] &@list

(*{{1, 11}, {2, 7}, {7, 9}}*)