Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10714 > unrolled thread

Re: case of inconsistent API between Drop and Part?

Started byBill Rowe <readnews@sbcglobal.net>
First post2012-07-01 06:09 +0000
Last post2012-07-01 06:09 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: case of inconsistent API between Drop and Part? Bill Rowe <readnews@sbcglobal.net> - 2012-07-01 06:09 +0000

#10714 — Re: case of inconsistent API between Drop and Part?

FromBill Rowe <readnews@sbcglobal.net>
Date2012-07-01 06:09 +0000
SubjectRe: case of inconsistent API between Drop and Part?
Message-ID<jsopik$u0$1@smc.vnet.net>
On 6/30/12 at 5:17 AM, nma@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}

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web