Re: case of inconsistent API between Drop and Part?
- To: mathgroup at smc.vnet.net
- Subject: [mg127117] Re: case of inconsistent API between Drop and Part?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sun, 1 Jul 2012 02:08:11 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
On 6/30/12 at 5:17 AM, nma at 12000.org (Nasser M. Abbasi) wrote: >using the Drop function, there is >no direct way to tell it to Drop element 2 AND element 4 in one >command. (there are easy ways to do this, but not using one >function call of Drop as is). (one easy solution is to complement >the elements to drop, and use Part instead, and other ways) This can be done using one call to Drop as follows: In[5]:= test = Range[8]; Fold[Drop[#1, {#2}] &, test, {4, 2}] Out[6]= {1,3,5,6,7,8}