title: Python - Aggregate by month and calculate average
body: <p>I have a csv which looks like this:</p>
  
  <pre><code>Date,Sentiment
  2014-01-03,0.4
  2014-01-04,-0.03
  2014-01-09,0.0
  2014-01-10,0.07
  2014-01-12,0.0
  2014-02-24,0.0
  2014-02-25,0.0
  2014-02-25,0.0
  2014-02-26,0.0
  2014-02-28,0.0
  2014-03-01,0.1
  2014-03-02,-0.5
  2014-03-03,0.0
  2014-03-08,-0.06
  2014-03-11,-0.13
  2014-03-22,0.0
  2014-03-23,0.33
  2014-03-23,0.3
  2014-03-25,-0.14
  2014-03-28,-0.25
  etc
  </code></pre>
  
  <p>And my goal is to aggregate date by months and calculate average of months. Dates might not start with 1. or January. Problem is that I have a lot of data, that means I have more years. For this purpose I would like to find the soonest date (month) and from there start counting months and their averages. For example:</p>
  
  <pre><code>Month count, average
  1, 0.4 (&lt;= the earliest month)
  2, -0.3
  3, 0.0
  ...
  12, 0.1
  13, -0.4 (&lt;= new year but counting of month is continuing)
  14, 0.3
  </code></pre>
  
  <p>I'm using Pandas to open csv </p>
  
  <pre><code>data = pd.read_csv("pks.csv", sep=",")
  </code></pre>
  
  <p>so in <code>data['Date']</code> I have dates and in <code>data['Sentiment']</code> I have values. Any idea how to do it?</p>