Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. readme = sc.textFile("README.md")
  2.  
  3. wordCounts = readme.flatMap(lambda line: line.split()).map(lambda word: (word,
  4. 1)).reduceByKey(lambda a, b: a+b)
  5.  
  6. wordCounts.collect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement