MathGroup Archive 2007

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

Search the Archive

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:
  • Prev by Date: User interface size and default stylesheet
  • Next by Date: Re: Can't abort a loop with Print inside (V6)
  • Previous by thread: Select[ ] Woes
  • Next by thread: Re: Select[ ] Woes