RE: List Question
- To: mathgroup at smc.vnet.net
- Subject: [mg67958] RE: [mg67889] List Question
- From: "David Park" <djmp at earthlink.net>
- Date: Thu, 13 Jul 2006 06:56:05 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Simon, Just map the pure function Take[#,2]& onto the data list. data = {{x1, y1}, {x2, y2}, {x3, y3, z3}, {x4, y4}}; Take[#, 2] & /@ data {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}} David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Simon Bale [mailto:simonjbale at gmail.com] To: mathgroup 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.