title: How to create a box plot for a grouped data
body: <p>I have the following pandas DataFrame <code>df</code>:</p>
  <pre><code>Datetime          Field1  Field2
  2018-10-01 10:00  10      13
  2018-10-01 11:00  18      14
  2018-10-01 12:00  11      16
  2018-10-01 13:00  12      15
  2018-10-01 14:00  13      15
  2018-10-01 15:00  11      11
  2018-10-02 10:00  14      15
  2018-10-02 11:00  15      15
  2018-10-02 12:00  12      12
  2018-10-02 13:00  11      15
  2018-10-02 14:00  10      13
  2018-10-02 15:00  10      15
  2018-10-03 10:00  15      11
  2018-10-03 11:00  13      12
  2018-10-03 12:00  11      12
  2018-10-03 13:00  11      11
  2018-10-03 14:00  11      13
  2018-10-03 15:00  12      15
  </code></pre>
  <p>I need to create a box plot to show how the values of <code>Field2</code> are distributed when grouped by <code>Field1</code>. The result should be conceptually similar to this plot, where <code>X</code> should be <code>Field1</code> and <code>Y</code> should be <code>Field2</code>):</p>
  <p><a href="https://i.stack.imgur.com/QyRHV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QyRHV.png" alt="enter image description here" /></a></p>
  <p>This is what I tried:</p>
  <pre><code>df = df.set_index(&quot;Field1&quot;)
  grouped = df.groupby(level=&quot;Field1&quot;)
  grouped.boxplot(rot=45, fontsize=12, figsize=(10,5))
  </code></pre>
  <p>But this code gets stuck and does not provide any results.</p>