MathGroup Archive 1999

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

Search the Archive

Re: List Position

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15794] Re: List Position
  • From: "Martin Rommel" <rommel at semitest.com>
  • Date: Sun, 7 Feb 1999 02:04:11 -0500 (EST)
  • Organization: EarthLink Network, Inc.
  • References: <79eagc$9ig@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Harry flynn wrote in message <79eagc$9ig at smc.vnet.net>...
>Can anyone tell me how I find the position in a list of the first value
>less than or equal to zero.
>For example, how can I get Mathematica to tell me that in the list
>{{1},{1},{2},{8},{-3}}
>that the first value of interest to me is position 5. Thanks in advance.
>Harry.


It sure is ugly, but it works.

lst={{1},{1},{2},{8},{-3}};

Position[lst,Select[Flatten[lst],#<=0&]]//Flatten//First

I am looking forward to see some more elegant solutions.

Martin.



  • Prev by Date: Re: BracketingBar for output
  • Next by Date: Re: Q: how to list vertices of the Geodesate[] of a polyhedron?
  • Previous by thread: Re: List Position
  • Next by thread: Re: List Position