Re: Select from list
- To: mathgroup at smc.vnet.net
- Subject: [mg61082] Re: [mg61045] Select from list
- From: Igor Antonio <igora at wolf-ram.com>
- Date: Sun, 9 Oct 2005 01:36:26 -0400 (EDT)
- Organization: Wolfram Research, Inc.
- References: <200510080649.CAA20981@smc.vnet.net>
- Reply-to: igora at wolf-ram.com
- Sender: owner-wri-mathgroup at wolfram.com
Steven Taracevicz wrote:
> hi:
>
> I read a text file that gives me a list.
> nLevel[8, 10] = Import["output8_10.txt", "List"]
>
> {-10,-9,-7,-3,1,3,3,17}
>
> I have no problems calculating mean, variance etc. with the list.
>
> When I use:
>
> Select[nLevel[8,10], #<0]
>
> yields
>
> {}
>
> despite negative elements.
>
> I cannot figure out why.
>
> Thanks,
>
Steven,
Your syntax is incorrect. The second argument of Select needs to be a
*function* (either built-in or a pure funtion). Note the "&" you're missing.
In[2]:=
Select[{-10,-9,-7,-3,1,3,3,17}, (#<0)&]
Out[2]=
{-10,-9,-7,-3}
--
Igor C. Antonio
Wolfram Research, Inc.
http://www.wolfram.com
To email me personally, remove the dash.
- References:
- Select from list
- From: "Steven Taracevicz" <sftara@starshooter.com>
- Select from list