1
$\begingroup$

I have a big list, for simple, it just like:

list = {
        {1, Overflow[], 3}, 
        {Overflow[], Overflow[], 7}, 
        {Overflow[], 4, 2}, {7, 8, 9},
        {-1, Overflow[], 3}, {-1, 10, 10}
       };

I don't know where contain Overflow[], so I want to filter the list by Select[] function, If Overflow[] at the first position, I know it will work by:

Select[list, Not[#[[1]] == Overflow[]] &]

It will return {{1, Overflow[], 3}, {7, 8, 9}, {-1, Overflow[], 3}, {-1, 10, 10}}

Is there any way to check all the positions, return {{7, 8, 9}, {-1, 10, 10}}?

$\endgroup$
0

1 Answer 1

2
$\begingroup$
Select[list, FreeQ[Overflow[]]]
(* {{7, 8, 9}, {-1, 10, 10}} *)

Select[list, Not@*MemberQ[Overflow[]]]
(* {{7, 8, 9}, {-1, 10, 10}} *)

Select[list, ContainsNone[{Overflow[]}]]
(* {{7, 8, 9}, {-1, 10, 10}} *)
$\endgroup$
1
  • $\begingroup$ Your answer is well done. $\endgroup$
    – zongxian
    Aug 12, 2019 at 23:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.