title: How to unpack the value (a list) of every item in a RDD in Python?
body: <p>I have a RDD and every item is of the form</p>
  
  <pre><code>(key, [ele1, ele2, ele3, ..., elen])
  </code></pre>
  
  <p>Every item is a key value pair and the value is a list of elements.</p>
  
  <p>I want to unpack the list such that I can create a new RDD with every item containing one element as follows:</p>
  
  <pre><code>(key, ele1)
  (key, ele2)
  (key, ele3)
  .
  .
  .
  (key, ele4)
  </code></pre>
  
  <p>How can I do this in PySpark?</p>
  
  <p>I tried doing</p>
  
  <pre><code>RDD.flatmap(lambda line: line[1]) 
  </code></pre>
  
  <p>but that doesn't work.</p>