Re: Select[ ] Woes
- To: mathgroup at smc.vnet.net
- Subject: [mg83150] Re: [mg83126] Select[ ] Woes
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Tue, 13 Nov 2007 03:36:54 -0500 (EST)
- References: <200711121013.FAA11004@smc.vnet.net>
On 12 Nov 2007, at 19:13, Bruce Colletti wrote:
> Re 6.0.1 under WinXP.
>
> What's wrong with the Select statement? x is clearly a list of
> positive rationals, yet none are returned. The fragment is
> extracted from larger code.
>
> Thankx.
>
> Bruce
>
> ...
> Print@x;
> Print@Select[x, # > 0 &];
> ...
>
> {20400/12,25200/9,12000/6}
>
> {}
>
It seems clear that your list x is not a list of numbers, since in
Mathematica you can't get an output like 12000/6 but instead you will
always get:
12000/6
2000
This suggests that the objects at level 2 in x are not numbers,
perhaps they are strings or things like HoldForm[12000/6]. In the
latter case you could use:
Cases[x, z_ /; z > 0, Infinity]
Of course this won't work if the "numbers" are really strings.
Andrzej Kozlowski
- References:
- Select[ ] Woes
- From: Bruce Colletti <vze269bv@verizon.net>
- Select[ ] Woes