title: Pandas to sum and group by date index
body: <p>I have a list of records which I need to calculate sums per reference and group by month.</p>
  
  <p>Input</p>
  
  <pre><code>Date1;Date2;Company;Reference;Description;Value;Currency;
  24.01.2014;23.01.2014;Company1;Debit;Text;-100,00;EUR;
  24.01.2014;24.01.2014;Company2;Debit;Text;-130,00;EUR;
  21.01.2014;24.01.2014;Company1;Debit;Text;-50,00;EUR;
  21.01.2014;21.01.2014;Company3;Credit;Text;600,00;EUR;
  17.02.2014;16.01.2014;Company2;Debit;Text;-110,00;EUR;
  16.02.2014;16.01.2014;Company1;Credit;Text;40,00;EUR
  02.03.2014;02.03.2014;Company6;Debit;Text;90,00;EUR
  </code></pre>
  
  <p>Desired Output</p>
  
  <pre><code>         Credit Debit
  Date1                                                                  
  2014-01; 600;   -180   
  2014-02; 40;    -110   
  2014-03; NaN;   -90
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  import matplotlib.pyplot as plt
  import pylab
  DATA = pd.read_csv('C:\Users\Desktop\File.txt'
  CLEAN_VALUE=DATA['Value'].str.replace('.','').str.replace(',','.').astype(float)
  DATA['CLEAN_VALUE']=CLEAN_VALUE
  SUM=DATA['CLEAN_VALUE'].groupby(DATA['Reference']).sum()
  DATA['Date1']=pd.to_datetime(DATA['Date1'],dayfirst=True,unit='D')
  summe=DATA[:10].groupby(['Date1','Reference']).sum().unstack()
  Sorted=pd.date_range(2013-01-01,2014-03-01,freq="M").resample('H', how=len)
  </code></pre>
  
  <p>It is actually working fine until the last step when I try to group by month. I receive this error: </p>
  
  <blockquote>
  <pre><code>Error message TypeError: Only valid with DatetimeIndex or PeriodIndex. Any suggestions? Thanks in advance.
  </code></pre>
  </blockquote>