Re: DeleteCases
- To: mathgroup at smc.vnet.net
- Subject: [mg27918] Re: DeleteCases
- From: "Ian McInnes" <ian at whisper-wood.demon.co.uk>
- Date: Fri, 23 Mar 2001 04:31:52 -0500 (EST)
- References: <99chk4$8bn@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
DeleteCases is not appropriate for your use, since it operates on patterns,
not conditions.
Instead use Select:
t = Select[t, #<=2&]
removes all elements of t which are greater than 2.
Regards,
Ian McInnes.
"Robert Schuerhuber" <robert.schuerhuber at gmx.at> wrote in message
news:99chk4$8bn at smc.vnet.net...
> hi!
> i've a rather simple question with the deletecases, but unfortunately i
> couldn't find a clue in the mathematica-help (again ..):
>
> i want to to use DeleteCases to remove number of lists, which are
> greater than a given limit, eg.
>
> t={1,2,3,4}
> DeleteCases[t, ????]
>
> should remove all entries greater than 2, therefore
>
> t={1,2}
>
> which pattern do i have to use?
>
> regards, robert
>
>