Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: How do I use BooleanSelect?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6405] Re: [mg6390] How do I use BooleanSelect?
  • From: BobHanlon at aol.com
  • Date: Sun, 16 Mar 1997 19:25:20 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

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?