title: Pandas Correlation Groupby
body: <p>Assuming I have a dataframe similar to the below, how would I get the correlation between 2 specific columns and then group by the 'ID' column?  I believe the Pandas 'corr' method finds the correlation between all columns.  If possible I would also like to know how I could find the 'groupby' correlation using the .agg function (i.e. np.correlate).</p>
  <p>What I have:</p>
  <pre><code>ID  Val1    Val2    OtherData   OtherData
  A   5       4       x           x
  A   4       5       x           x
  A   6       6       x           x
  B   4       1       x           x
  B   8       2       x           x
  B   7       9       x           x
  C   4       8       x           x
  C   5       5       x           x
  C   2       1       x           x
  </code></pre>
  <p>What I need:</p>
  <pre><code>ID  Correlation_Val1_Val2
  A   0.12
  B   0.22
  C   0.05
  </code></pre>