forked from jackzhenguo/python-small-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmovies.py
More file actions
18 lines (12 loc) · 656 Bytes
/
movies.py
File metadata and controls
18 lines (12 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pandas as pd
import numpy as np
movies = pd.read_csv('./data/movietweetings/movies.dat', delimiter='::',
engine='python', header=None, names=['Movie ID', 'Movie Title', 'Genre'])
print(movies.head())
users = pd.read_csv('./data/movietweetings/users.dat', delimiter='::',
engine='python', header=None, names=['User ID', 'Twitter ID'])
ratings = pd.read_csv('./data/movietweetings/ratings.dat', delimiter='::', engine='python',
header=None, names=['User ID', 'Movie ID', 'Rating', 'Rating Timestamp'])
print(users.head())
print(ratings.head())
movies.loc['Genre']