pandas pivot_table keep index
<p>i have a dataframe :</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd

data = {'day_bucket': ['2011-01-21', '2011-01-22', '2011-01-23', '2011-01-24'], 'label': ['birds', 'birds', 'birds', 'birds'], 'numeric_value': [4, 0, 7, 3]}

df = pd.DataFrame(data)

   day_bucket  label  numeric_value
0  2011-01-21  birds              4
1  2011-01-22  birds              0
2  2011-01-23  birds              7
3  2011-01-24  birds              3
</code></pre>
<p>I want to pivot this dataframe so that i have a column <code>birds</code> with the values below it.</p>
<pre><code>pd.pivot_table(df, values='numeric_value', index='day_bucket',columns='label')  
</code></pre>
<p>gives:</p>
<pre><code>label       birds
day_bucket             
2011-01-21  4
2011-01-22  0
2011-01-23  7
2011-01-24  3
</code></pre>
<p>what should i do the keep the index? The result will look like:</p>
<pre><code>    day_bucket birds    
0   2011-01-21  4
1   2011-01-22  0
2   2011-01-23  7
3   2011-01-24  3 
</code></pre>