Grouping by month-year after using datetime.strptime
<p>I'm fairly new at this. I have a csv that has a string date/time column as shown below. I am trying to average flow values based on month-year.</p>

<p>CSV:</p>

<pre><code>X                   Flow
6/9/16/ 14:00       15000
</code></pre>

<p>Code:</p>

<pre><code>import pandas as pd
from datetime import datetime

#import csv
df = pd.read_csv('monthlyaverage.csv', header=True)

date_object = datetime.strptime('6/9/16 14:00', '%m/%d/%y %H:%M')

df.set_index(pd.DatetimeIndex(df))

df1 = df.groupby(pd.TimeGrouper(freq='%m/%y')).mean()
</code></pre>