SHARE
TWEET

Untitled

a guest Jan 19th, 2016 151 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. r1 = lines.map(lambda x: x.split("\n"))
  2. r2 = r1.map(lambda x: x[0].split(','))
  3. r2.take(10)
  4. r3 = r2.map(lambda x: ( x[2].split('-')[0], x[12]))
  5. r4 = r3.groupByKey().mapValues(list).collect()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top