title: Flip a Dataframe
body: <p>I am working on Databricks using Python 2.</p>
  
  <p>I have a PySpark dataframe like:</p>
  
  <pre><code>|Germany|USA|UAE|Turkey|Canada...
  |5      | 3 |3  |42    | 12..
  </code></pre>
  
  <p>Which, as you can see, consists of hundreds of columns and only one single row.</p>
  
  <p>I want to flip it in a way such that I get:</p>
  
  <pre><code>Name   | Views
  --------------
  Germany| 5
  USA    | 3 
  UAE    | 3
  Turkey | 42
  Canada | 12
  </code></pre>
  
  <p>How would I approach this?</p>
  
  <p>Edit: I have hundreds of columns so I can't write them down. I don't know most of them, but they just exist there. I can't use the columns names in this process.</p>
  
  <p>Edit 2: Example code:</p>
  
  <pre><code>dicttest = {'Germany': 5, 'USA': 20, 'Turkey': 15}
  rdd=sc.parallelize([dicttest]).toDF()
  df = rdd.toPandas().transpose()
  </code></pre>