How do I find the mean of a set of numbers in a given time period in Ruby (especially in a csv file)?
Here's a simple example of what I have in my CSV file:

    "1","January 3, 2012"
    "2","January 3, 2012"
    "3","May 4, 2012"
    "4","May 4, 2012"
    "5","May 4, 2012"
    "6","June 8, 2012"
    "7","June 9, 2012"
    "9","June 10, 2012"
    "10","July 4, 2012"
    "11","July 4, 2012"
    "12","August 18, 2012"

I'd like my output to have the average value for each date (e.g., the average for January 3, 2012 is 1.5).

I have the 'crack' gem, so I can use the 'Time.parse' syntax, though I wonder if there's a way to do this without using any gems (or at least, nothing more than the 'crack' gem).

But feel free to also post code which uses gems. I can try out both vanilla and gem-enhanced to see which I prefer.

Thanks in advance.
How do I find the mean of a set of numbers in a given time period in Ruby (especially in a csv file)?
===

Here's a simple example of what I have in my CSV file:

    "1","January 3, 2012"
    "2","January 3, 2012"
    "3","May 4, 2012"
    "4","May 4, 2012"
    "5","May 4, 2012"
    "6","June 8, 2012"
    "7","June 9, 2012"
    "9","June 10, 2012"
    "10","July 4, 2012"
    "11","July 4, 2012"
    "12","August 18, 2012"

I'd like my output to have the average value for each date (e.g., the average for January 3, 2012 is 1.5).

I have the 'crack' gem, so I can use the 'Time.parse' syntax, though I wonder if there's a way to do this without using any gems (or at least, nothing more than the 'crack' gem).

But feel free to also post code which uses gems. I can try out both vanilla and gem-enhanced to see which I prefer.

Thanks in advance.