Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

CategoryCounts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61403] CategoryCounts
  • From: Gregory Lypny <gregory.lypny at videotron.ca>
  • Date: Tue, 18 Oct 2005 02:44:49 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Everyone,

     I'm having trouble with the bivariate form of CategoryCounts.

I have an 1000 x 11 array named h1 whose 9th and 11th columns contain  
the month and year, such as

h1[[All, {9,11}]={{October, 1999}, {October, 1999}, {October, 1999},  
{August, 1999}, {August, 1999},...}

Picking off months is no problem because
CategoryCounts[h1[[All, 9]], {"October", "July", "August"}]
correctly gives me {38, 752, 210}.

And picking off years is also no problem because
CategoryCounts[h1[[All, 11]], {1999, 2000, 2001, 2002, 2003}]
correctly gives me {1000, 0, 0, 0, 0} (the first 1,000 observations  
all occurred in 1999).

But picking off months and years does not give me the 3 x 5 array  
that I expect:
CategoryCounts[h1[[All, {9,11}]], {{"October", "July", "August"},  
{1999, 2000, 2001, 2002, 2003}}]
yields {0, 0}.

     What am I doing wrong?  Any advice would be most appreciated.

         Greg


  • Prev by Date: Generating unitary aliquot cycles
  • Next by Date: Re: interactive web Mathematica examples on Math World not working under firefox?
  • Previous by thread: Generating unitary aliquot cycles
  • Next by thread: Re: CategoryCounts