title: pandas: problem using diff with groupby when index is non-unique
body: <p>I am using <a href="/questions/tagged/pandas" class="post-tag" title="show questions tagged &#39;pandas&#39;" rel="tag">pandas</a> (version 0.20.3) and I want to apply the <code>diff()</code> method with <code>groupby()</code> but instead of a DataFrame, the result is an &quot;underscore&quot;.</p>
  <p>Here is the code:</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  # creating the DataFrame
  data = np.random.random(18).reshape(6,3)
  indexes = ['B']*3 + ['A']*3
  columns = ['x', 'y', 'z']
  df = pd.DataFrame(data, index=indexes, columns=columns)
  df.index.name = 'chain_id'
  
  # Now I want to apply the diff method in function of the chain_id
  df.groupby('chain_id').diff()
  </code></pre>
  <p>And the result is an underscore!</p>
  <p>Note that <code>df.loc['A'].diff()</code> and <code>df.loc['B'].diff()</code> do return the expected results so I don't understand why it wouldn't work with <code>groupby()</code>.</p>