Re: Position of element in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg16347] Re: [mg16301] Position of element in a list
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Thu, 11 Mar 1999 02:16:31 -0500
- Sender: owner-wri-mathgroup at wolfram.com
In[16]:= Position[{-1, 3, -2, 1},x_?Negative] Out[16]= {{1}, {3}} or In[19]:= Position[{-1, 3, -2, 1},x_/;x<0] Out[19]= {{1}, {3}} On Sun, Mar 7, 1999, 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}, -_] > >and > >Position[{-1, 3, -2, 1}, -x_] > >return > >{} > >So how do I perform this apparently simple task? > >Thanks, > >Roger Mason > Andrzej Kozlowski Toyama International University JAPAN http://sigma.tuins.ac.jp/ http://eri2.tuins.ac.jp/