title: How do I transpose columns into rows of a Pandas DataFrame?
body: <p>My current data frame is comprised of 10 rows and thousands of columns. The setup currently looks similar to  this:</p>
  <pre><code>A   B   A   B
  1   2   3   4
  5   6   7   8
  </code></pre>
  <p>But I desire something more like below, where essentially I would transpose the columns into rows once the headers start repeating themselves.</p>
  <pre><code>A   B
  1   2
  5   6
  3   4
  7   8
  </code></pre>
  <p>I've been trying <code>df.reshape</code> but perhaps can't get the syntax right. Any suggestions on how best to transpose the data like this?</p>