Re: Extracting a sub-list?
- To: mathgroup at smc.vnet.net
- Subject: [mg37946] Re: [mg37933] Extracting a sub-list?
- From: jmt <jmt at dxdydz.net>
- Date: Thu, 21 Nov 2002 00:38:14 -0500 (EST)
- References: <200211201409.JAA06448@smc.vnet.net>
- Reply-to: jmt at dxdydz.net
- Sender: owner-wri-mathgroup at wolfram.com
Cases[%,_Integer]
will return {1,2}
On Wednesday 20 November 2002 15:09, 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
- References:
- Extracting a sub-list?
- From: "AngleWyrm" <no_spam_anglewyrm@hotmail.com>
- Extracting a sub-list?