Re: Q: DeleteCases
- To: mathgroup at smc.vnet.net
- Subject: [mg27904] Re: [mg27862] Q: DeleteCases
- From: Adalbert Hanssen <hanssen at zeiss.de>
- Date: Fri, 23 Mar 2001 04:31:27 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Robert! DeleteCases[Range[10],3] returns: {1, 2, 4, 5, 6, 7, 8, 9, 10} but probably you are after something like this: Select[Range[10],((#>3)&&EvenQ[#])&] which returns {4, 6, 8, 10} the second argument, ((#>3)&&EvenQ[#])& is a pure expression. You might aternatively define a function, which returns True or False, depending on your selection critereon, e.g. f[x_]:=((x>3) && EvenQ[x]) Select[Range[10],f] which does the same thing, but needs an extra symbol. regards Adalbert