title: Convert Column of List to Dataframe
body: <p>I have a column of lists in a spark dataframe. </p>
  
  
  
  <pre class="lang-python prettyprint-override"><code>+-----------------+
  |features         |
  +-----------------+
  |[0,45,63,0,0,0,0]|
  |[0,0,0,85,0,69,0]|
  |[0,89,56,0,0,0,0]|
  +-----------------+
  </code></pre>
  
  <p>How do I convert that to a spark dataframe where each element in the list is a column in the dataframe? We can assume that the lists will be the same size. </p>
  
  <p>For Example, </p>
  
  <pre class="lang-python prettyprint-override"><code>+--------------------+
  |c1|c2|c3|c4|c5|c6|c7|
  +--------------------+
  |0 |45|63|0 |0 |0 |0 |
  |0 |0 |0 |85|0 |69|0 |
  |0 |89|56|0 |0 |0 |0 |
  +--------------------+
  </code></pre>