Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10714 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2012-07-01 06:09 +0000 |
| Last post | 2012-07-01 06:09 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: case of inconsistent API between Drop and Part? Bill Rowe <readnews@sbcglobal.net> - 2012-07-01 06:09 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2012-07-01 06:09 +0000 |
| Subject | Re: 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}
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web