MathGroup Archive 1999

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

Search the Archive

Re: Parts of a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15450] Re: [mg15430] Parts of a list
  • From: BobHanlon at aol.com
  • Date: Mon, 18 Jan 1999 04:21:51 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 1/14/99 12:49:51 AM, kazemi at som.umass.edu writes:

>I have a list (matrix) that looks like this
>
>x={{1,0},{2.5, .5},{3,0},{0,2}}
>
>Now I want to eliminate those vectors that have zero for the second
>case. That is, I want to get
>
>{{2.5, .5},{0,2}}.
>
>Is there a quick way of doing this?
>I tried to apply Select to this but could not get it to work.
>
x={{1,0},{2.5, .5},{3,0},{0,2}};

Select[x, #[[2]] != 0&]

{{2.5, 0.5}, {0, 2}}

Bob Hanlon


  • Prev by Date: Re: list of lists
  • Next by Date: Special characters
  • Previous by thread: Re: Parts of a list
  • Next by thread: Re: Parts of a list