Skip to content

Instantly share code, notes, and snippets.

@dradecic
Created September 29, 2019 10:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dradecic/ef33ad4c942c2d013def6ed0c4945bc8 to your computer and use it in GitHub Desktop.
recommender1_6_num_ratings
num_ratings = pd.DataFrame(data.groupby('movieId').count()['rating']).reset_index()
data = pd.merge(left=data, right=num_ratings, on='movieId')
data.rename(columns={'rating_x': 'rating', 'rating_y': 'numRatings'}, inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment