Skip to content

Instantly share code, notes, and snippets.

@MLWhiz
Created July 3, 2019 16:18
Show Gist options
  • Save MLWhiz/eeb1b981885e42e18e92c79ab7ada4df to your computer and use it in GitHub Desktop.
Save MLWhiz/eeb1b981885e42e18e92c79ab7ada4df to your computer and use it in GitHub Desktop.
print(((ratingRDD.map(lambda x : (x.split("\t")[1],x.split("\t")[2]))).
leftOuterJoin(movieRDD.map(lambda x : (x.split("|")[0],x.split("|")[1])))).
map(lambda x: (x[1][1],1)).
reduceByKey(lambda x,y: x+y).
takeOrdered(25,lambda x:-x[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment