title: How to flatten an RDD in python?
body: <p>I have a dataset of spam msgs and it has this datatype:</p>
  
  <p><code>pyspark.rdd.PipelinedRDD</code></p>
  
  <p>When I do <code>spams.take(3)</code>, I get:</p>
  
  <p><code>[["Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&amp;C's apply 08452810075over18's"],
   ['WINNER!! As a valued network customer you have been selected to receivea £900 prize reward! To claim call 09061701461. Claim code KL341. Valid 12 hours only.'],
   ['Had your mobile 11 months or more? U R entitled to Update to the latest colour mobiles with camera for Free! Call The Mobile Update Co FREE on 08002986030']]</code></p>
  
  <p>As you can see it has brackets within to separate each element within the list. How can I get rid of those brackets? I tried many ways of Flattening it but none seems to work.</p>