Skip to content

Instantly share code, notes, and snippets.

@mayukh18
Last active November 20, 2019 17:02
Show Gist options
  • Save mayukh18/70b32a212151dd645a4031b033e59ede to your computer and use it in GitHub Desktop.
Save mayukh18/70b32a212151dd645a4031b033e59ede to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
data = pd.read_csv('movielens100k.csv')
data['userId'] = data['userId'].astype('string')
data['movieId'] = data['movieId'].astype('string')
users = list(set(data['userId'])) #list of all users
movies = list(set(data['movieId'])) #list of all movies
print(len(users))
print(len(movies))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment