Re: Position of element in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg16404] Re: Position of element in a list
- From: gaylord at ux1.cso.uiuc.edu (richard j. gaylord)
- Date: Thu, 11 Mar 1999 02:17:03 -0500
- Organization: university of illinois
- References: <7bt665$ndn@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <7bt665$ndn at smc.vnet.net>, Roger Mason
<rmason at sparky2.esd.mun.ca> wrote:
> Hi,
>
> I want to find the Position[] of negative elements in a list. The obvious
> methods do not work:
>
> Position[{-1, 3, -2, 1}, -_]
>
use
In[3]:=
Position[{-1, 3, -2, 1}, _?Negative]
Out[3]=
{{1},{3}}
--
"I would say life is pretty pointless, wouldn't you, without the movies?"
Vincent Gallo as Johnny Tempi in The Funeral (1996)