MathGroup Archive 2006

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

Search the Archive

Re: List Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67931] Re: [mg67889] List Question
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Thu, 13 Jul 2006 06:53:40 -0400 (EDT)
  • References: <200607120905.FAA22137@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Jul 12, 2006, at 5:05 AM, Simon Bale wrote:

> Hi,
>
> I have a list with the following structure:
>
> {{x1,y1},{x2,y2},{x3,y3,z3},{x4,y4}...}
>
> As you can see some of the data points have three elements. I would
> like to remove these z elements so that the list has a structure
> {{x1,y1},{x2,y2},{x3,y3},{x4,y4}...}. I'm not sure how to achieve this
> so any
> help is greatly appreciated.


If[Length[#]==3,Take[#,2],#]&/@{{x1,x2},{x2,y2},{x3,y3,z3},{x4,y4}...}

Regards,

Ssezi


  • References:
  • Prev by Date: RE: List Question
  • Next by Date: Re: List Question
  • Previous by thread: List Question
  • Next by thread: Re: List Question