Pandas: Group by date and the median of another variable
<p>This is a demo example of my DataFrame. The full DataFrame has multiple additional variables and covers 6 months of data.</p>

<pre><code>sentiment     date
1             2015-05-26 18:58:44
0.9           2015-05-26 19:57:31
0.7           2015-05-26 18:58:24
0.4           2015-05-27 19:17:34
0.6           2015-05-27 18:46:12
0.5           2015-05-27 13:32:24
1             2015-05-28 19:27:31
0.7           2015-05-28 18:58:44
0.2           2015-05-28 19:47:34
</code></pre>

<p>I want to group the DataFrame by just the day of the <code>date</code> column, but at the same time aggregate the median of the <code>sentiment</code> column. </p>

<p>Everything I have tried with <code>groupby</code>, the <code>dt</code> accessor and <code>timegrouper</code> has failed. </p>

<p>I want to return a pandas DataFrame not a GroupBy object.</p>

<p>The date column is <code>M8[ns]</code>  </p>

<p>The sentiment column <code>float64</code> </p>