Re: Count Function
- To: mathgroup at smc.vnet.net
- Subject: [mg65507] Re: [mg65501] Count Function
- From: "David Annetts" <davidannetts at aapt.net.au>
- Date: Thu, 6 Apr 2006 06:51:48 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Gregory,
> The syntax will be the death of me.
> Count[X[[All,14]], -9.] will tally how many elements in
> column 14 of matrix X are equal to -9, but I can't for the
> life of me figure out how to get how many are greater than
> -9. Any hint would be most appreciated.
Try select ...
If
data = Random[Integer, {-10, 10}] & /@ Range[32]
Then
a = Select[data, (# > -9) &]
b = Select[data, (# ? -9) &]
And
SameQ[32, Length@a + Length@b]
Regards,
Dave.