title: How can I use Python to use repeating column value to separate rows in a dataframe?
body: <p>I have an Excel file with a repeating column value that I want to use to group records for insertion into a database. My approach is to use Pandas. Here is a representative dataframe:</p>
  <pre><code>import pandas as pd
  import numpy as np
  df2 = pd.DataFrame({
      'a': ['foo', 'q1', 'q2', 'q3', 'foo', 'q1', 'q2', 'q3'],
      'b': ['bar', 'Zee', np.nan, 500, 'baz', 'Jay', 'Yes', 100]})
  </code></pre>
  <p>I want transpose it to this:</p>
  <pre><code>df3 = pd.DataFrame({
      'foo': ['bar', 'baz'],
      'q1': ['Zee', 'Jay'],
      'q2': [numpy.nan, 'Yes'],
      'q3': [500, 100]})
  </code></pre>
  <p>by using the 'foo' value to separate rows or records. How can I do this?</p>