MathGroup Archive 2006

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

Search the Archive

Re: List Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67923] Re: List Question
  • From: "Scout" <Scout at nodomain.com>
  • Date: Thu, 13 Jul 2006 06:53:22 -0400 (EDT)
  • References: <e92e03$ljm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Simon Bale" <simonjbale at gmail.com>
 news:e92e03$ljm$1 at smc.vnet.net...
> 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.
>
> Regards, Simon Bale.
>

One simple solution is:

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

Regards,
      ~Scout~


  • Prev by Date: Re: Use color with ListPlot?
  • Next by Date: Re: Odd graphic, looks different in different Adobe apps
  • Previous by thread: Re: List Question
  • Next by thread: Re: List Question