Generation

generate functionTue, 24 Jan 2023

There is a Pandas dataframe: userId movieId rating timestamp 0 1 31 2.5 1260759144 1 1 1029 3.0 1260759179 2 1 1061 3.0 1260759182 3 1 1129 2.0 1260759185 4 1 1172 4.0 1260759205 leave in this dataframe only users who have rated 100 or more in the rating column

import pandas as pd r_cols = ['user_id', 'movie_id', 'rating', 'unix_timestamp'] ratings = pd.read_csv('u.data', sep='\t', names=r_cols,encoding='latin-1') ratings = ratings.drop('unix_timestamp', axis=1) ratings.head()

Questions about programming?Chat with your personal AI assistant