MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How do I use BooleanSelect?


Needs["Statistics`DataManipulation`"]

testa = {1,2,3,4,-2,y,6,7};
testb={{1,2},{-2,3},{23,56},{90,54},{-2,-200}};

The second input to BooleanSelect must also be a lsit.  For example, for 
testa:

BooleanSelect[testa, NumberQ /@ testa]

{1,2,3,4,-2,6,7}

However, for this case just use Select:

Select[testa, NumberQ]

{1,2,3,4,-2,6,7}

For testb:

BooleanSelect[testb, (FreeQ[#, -2] && FreeQ[#, -200])& /@ testb]

{{1,2},{23,56},{90,54}}

Likewise, use Select

Select[testb, FreeQ[#, -2] && FreeQ[#, -200]&]

{{1,2},{23,56},{90,54}}

BooleanSelect is useful when the Boolean list is a second independent input.


Bob Hanlon


  • Prev by Date: Outer Question
  • Next by Date: Mathematica Journal Article electronic submission mystery
  • Previous by thread: How do I use BooleanSelect?
  • Next by thread: How do I use BooleanSelect?