Re: Cases
- To: mathgroup at smc.vnet.net
- Subject: [mg50447] Re: [mg50423] Cases
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 4 Sep 2004 01:43:23 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
If d is a Symbol, Not[d] is not a boolean Not[d] ¬d x={a,b,c,d,d}; Cases[x,_?(!(#===d)&)] {a, b, c} Select[x,!(#===d)&] {a, b, c} Bob Hanlon > > From: "Blimbaum, Jerry AA R22" <jerry.blimbaum at navy.mil> To: mathgroup at smc.vnet.net > Date: 2004/09/03 Fri AM 03:35:08 EDT > To: mathgroup at smc.vnet.net > Subject: [mg50447] [mg50423] Cases > > > Given: x = {a,b,c,d,d}; > > Applying Cases[x,d] gives an output of {a,b,c}...... > > However, Cases[x,Not[d]] gives as output an empty list { }... I > expected {a,b,c}..... > > Why didnt I get that? > > This issue came up when using Thread on vectors...and in some cases the > Thread resulted in 0 == 0 so it's output in the list was > True....and I > wanted to remove them.... > > thanks.....jerry blimbaum > >