How to plot data after groupby
<p>I have a data frame similar to this</p>

<pre><code>import pandas as pd
df = pd.DataFrame([['1','3','1','2','3','1','2','2','1','1'], ['ONE','TWO','ONE','ONE','ONE','TWO','ONE','TWO','ONE','THREE']]).T
df.columns = [['age','data']]
print(df)   #printing dataframe.
</code></pre>

<p>I performed the groupby function on it to get the required output.</p>

<pre><code>df['COUNTER'] =1       #initially, set that counter to 1.
group_data = df.groupby(['age','data'])['COUNTER'].sum() #sum function
print(group_data)
</code></pre>

<p>now i want to plot the out using matplot lib. Please help me with it.. I am not able to figure how to start and what to do. 
I want to plot using the counter value and something similar to bar graph</p>

<p>Try:</p>

<pre><code>group_data = group_data.reset_index()
</code></pre>

<p>in order to get rid of the multiple index that the <code>groupby()</code> has created for you.</p>

<p>Your <code>print(group_data)</code> will give you this:</p>

<pre><code>In [24]: group_data = df.groupby(['age','data'])['COUNTER'].sum() #sum function

In [25]: print(group_data)
age  data 
1    ONE      3
     THREE    1
     TWO      1
2    ONE      2
     TWO      1
3    ONE      1
     TWO      1
Name: COUNTER, dtype: int64
</code></pre>

<p>Whereas, reseting will 'simplify' the new index:</p>

<pre><code>In [26]: group_data = group_data.reset_index()

In [27]: group_data
Out[27]: 
  age   data  COUNTER
0   1    ONE        3
1   1  THREE        1
2   1    TWO        1
3   2    ONE        2
4   2    TWO        1
5   3    ONE        1
6   3    TWO        1
</code></pre>

<p>Then depending on what it is exactly that you want to plot, you might want to take a look at the <a href="http://pandas.pydata.org/pandas-docs/stable/visualization.html" rel="nofollow">Matplotlib docs</a></p>

<p><strong>EDIT</strong></p>

<p>I now read more carefully that you want to create a 'bar' chart.</p>

<p>If that is the case then I would take a step back and <strong>not</strong> use <code>reset_index()</code> on the groupby result. Instead, try this:</p>

<pre><code>In [46]: fig = group_data.plot.bar()

In [47]: fig.figure.show()
</code></pre>

<p>I hope this helps</p>

python pandas matplotlib