I have the following csv files:
# simulate a csv file
from StringIO import StringIO
data = StringIO("""
2012-04-01,00:10, A, 10
2012-04-01,00:20, B, 11
2012-04-01,00:30, B, 12
2012-04-02,00:10, A, 18
2012-05-02,00:20, A, 14
2012-05-02,00:30, B, 11
2012-05-03,00:10, A, 10
2012-06-03,00:20, B, 13
2012-06-03,00:30, C, 12
""".strip())
which I would like to gropu by year+month plus category (ie. A, B, C).
I would like the final data to have grouping by month and then by category
as a view of the original data
2012-04, A
>> array[0,] => 2012-04-01,00:10, A, 10
>> array[3,] => 2012-04-02,00:10, A, 18
2012-04, B
>> array[1,] => 2012-04-01,00:20, B, 11
<