-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
37 lines (26 loc) · 792 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import csv
filename = "ratings50.csv"
sparsematrix = []
overall_movie_rating_mean = 0
mx = 0
with open(filename) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
if line_count == 0:
line_count += 1
else:
print(f'{row[0]} \t {row[1]} \t {row[2]}')
if int(row[1]) > mx:
mx = int(row[1])
i = row[0]
entry = []
entry.append(row[0])
entry.append(row[1])
entry.append(row[2])
sparsematrix.append(entry)
line_count += 1
# if line_count == 3:
# break
line_count -= 1
print(f'Ratings Processsed: {line_count} \n max count : {mx} {i}')