MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: more looping trouble

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85463] Re: more looping trouble
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Mon, 11 Feb 2008 06:12:45 -0500 (EST)

On 2/10/08 at 5:20 AM, frankb.mail at gmail.com (Francis Bitonti) wrote:

>Sorry for these lame questions but I'm still trying to get my head
>around loops. I though I had it but I hit a snag today.

>I have a table of numbers {{1,2,3},{2,3,4}} I want to use a loop to
>remove the third integer in each set and reassemble them as a new
>table. However, something is going wrong I think it's because i'm
>not grasping some fundamental idea about how to perform these type
>of operations on tables.

I would not use a formal loop constructed with For to accomplish this.

The example given above only has three columns. So, deleting the
third element is the same as deleting the last element and

Most/@data

where data is your three column table will do what you want. If
your data had a large number of columns then you could do:

Join[#[[;;2]],#[[4;;]]]&/@data
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Import pdf problem
  • Next by Date: NDSolve Percision
  • Previous by thread: Re: more looping trouble
  • Next by thread: Re: more looping trouble