title: Counting events grouped by minutes on Pandas Time series
body: <p>Hi I have a time series and I would like to count how many events per minute that I have in the dataframe. Then I would like to group all the dates together and print the datetime with events. Finally I would like to output a line graph and histogram using both bokeh and matplotlib. </p>
  
  <pre><code>import numpy as np
  import pandas as pd
  from pandas import Series, DataFrame
  import matplotlib.pyplot as plt
  #alows you to see matplotlib in Inotepad
  %matplotlib inline
  dframe = pd.read_table('info.txt', sep=",", header = None)
  </code></pre>
  
  <p>I am importing a text file into Juypter and the dataframe is called dframe. The row is called datetime. I am using Juypter, pandas, numpy, bokeh, or matplotlib</p>
  
  <pre><code>dframe
  &lt;id&gt;     &lt;datetime&gt;
  0        20151227 06:51:30.218944
  1        20151227 06:51:36.913871
  2        20151227 06:51:37.198875
  3        20151227 06:51:37.574203
  4        20151227 06:51:37.286483
  5        20151227 06:51:37.635841
  6        20151227 06:51:38.070152
  7        20151227 06:51:38.255787
  8        20151227 06:51:38.188735
  9        20151227 06:51:38.255831
  10       20151227 06:51:38.255877
  11       20151227 06:51:38.255920
  12       20151227 06:51:38.893147
  13       20151227 06:51:38.686167
  </code></pre>
  
  <p>A Quick Example of the correct output would look like this output below, however I am unable to print the output because of the following error.</p>
  
  <pre><code>&lt;datetime&gt;                  event
  20151227 06:51:30.218944  1
  20151227 06:51:36.913871  2
  20151227 06:51:37.198875  4
  20151227 06:51:38.070152  8
  </code></pre>
  
  <p>When I resample data I receive the following error</p>
  
  <pre><code>dframe.datetime.resample('60Min', how=sum, base=30).plot()
  plt.show()
  
  
  TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex
  </code></pre>
  
  <p>how do I strip away the seconds and then group all the "datetimes" together and print datetimes with events Then plot on a line graph and histograph?</p>
  
  <p>Thank you in advance</p>