title: How to find bigram frequency on a RDD using Python
body: <pre><code>text_file = sc.textFile("/Users/xxx/Desktop/BigData/assign1/abc")
  count1 = text_file.flatMap(lambda line: line.split(" ")) 
               .map(lambda x : (x,  1)) \
           .reduceByKey(lambda a, b: a + b)
  </code></pre>
  
  <p>I am just taking this as an example. I have a huge dataset of 156215 entries</p>
  
  <p>['This', 'is', 'my', 'room']
  this returns me single word count.</p>
  
  <p>If I need to find count of two words at a time.</p>
  
  <p>['This is', 'is my', 'my room']</p>
  
  <p>I have tried everything but it returns TypeError: PipelinedRDD issue.</p>