Re: Drop elements from list
- To: mathgroup at smc.vnet.net
- Subject: [mg94216] Re: Drop elements from list
- From: Ray Koopman <koopman at sfu.ca>
- Date: Mon, 8 Dec 2008 06:21:38 -0500 (EST)
- References: <ghdmqj$flr$1@smc.vnet.net>
On Dec 6, 3:14 am, SigmundV <sigmu... at gmail.com> wrote: > Dear group, > > Consider a list of length, say, 20: > > a = RandomReal[{},20]; > > How would you then drop/delete elements, say, 2-5 and 7-10 from this > list? The built-in function Drop does not seem to include such a > possibility. I should add that I do not have access to Mathematica 7, > so any solution should work in version 6. > > Kind regards, > Sigmund I'm surprised no one mentioned Delete, as in Delete[a, Transpose@Flatten@{Range[2,5],Range[7,10]} ].