text_plain_output_1.png image_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data_movies = pd.read_csv('../input/movielens/movies.dat', sep='::', engine='python', header=None, names=['MovieId', 'Title', 'Genres'], encoding='latin 1')
data_ratings = pd.read_csv('../input/movielens/ratings.dat', sep='::', engine='python', header=None, names=['UserId', 'MovieId', 'Rating', 'Timestamp'], encoding='latin 1')
data_users = pd.read_csv('../input/movielens/users.dat', sep='::', engine='python', header=None, names=['UserId', 'Gender', 'Age', 'Occupation', 'Zip-code'], encoding='latin 1')

data_ratings.sort_values(by='Rating', ascending=False).head(25)

reviews2 = data_ratings.sort_values(by='Rating', ascending=False).head(5)

reviews2 = data_ratings.sort_values(by='Rating', ascending=False).head(5)

data = [data_ratings['Timestamp'], data_users['Occupation']]
headers = ['Timestamp1', 'Occupation1']
df3 = pd.concat(data, axis=1, keys=headers)

df3.sort_values(by='Timestamp1')