MathGroup Archive 2002

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

Search the Archive

Re: Extracting a sub-list?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37957] Re: [mg37933] Extracting a sub-list?
  • From: "Y.A.Tesiram" <yas at pcomm.hfi.unimelb.edu.au>
  • Date: Thu, 21 Nov 2002 00:38:44 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Cases[Table[x/2, {x, 1, 5}], _Integer]

Yas


On Wed, 20 Nov 2002, AngleWyrm wrote:

> How do I extract the subset of answers in a list that are pure integers?
> As an example,
>
> in:
> Table[x/2, {x, 1, 5}]
> IntegerQ /@ %
>
> out:
> { 1/2, 1, 3/2, 2, 5/2 }
> { False, True, False, True, False }
>
> But I want to get a result of:
> { 1, 2 }
>
> -:¦:-
> AngleWyrm
>
>
>



  • Prev by Date: RE: contour plot from a list
  • Next by Date: Re: Extracting a sub-list?
  • Previous by thread: Re: Extracting a sub-list?
  • Next by thread: Re: Extracting a sub-list?