title: How to I create split a line into pairs of words rather than singular words?
body: <p>I read a CSV file into an RDD in Jupyter and wanted to convert each line into a pair of words rather than singular words, and then to create tuples of the pairs of words, but have no idea how i should do it. The CSV file looks something like this:</p>
  
  <p>Afghanistan, AFG<br>
  Albania, ALB<br>
  Algeria, ALG<br>
  American Somoa, ASA<br>
  Anguilla, AIA</p>
  
  <p>I've tried this:</p>
  
  <p>lines = sc.textFile(...)
  words = lines.flatMap(lambda line : line.split (" "))</p>
  
  <p>but it doesn't return Albania, ALB as one tuple. Instead it counts Albania as one and ALB as another. Help please!</p>