Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. rdd = clean_headers_rdd.rdd
  2. .filter(lambda x: x['date'].year == 2016)
  3. .map(lambda x: (x['user_id'], 1)).reduceByKey(lambda x, y: x + y)
  4. .map(lambda (x, y): (y, x)).sortByKey(ascending = False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement