rishikasrinivas commited on
Commit
a3b2a61
·
verified ·
1 Parent(s): 345ae4e

Create load_data.py

Browse files
Files changed (1) hide show
  1. load_data.py +12 -0
load_data.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ def loadFileIntoDict(file):
4
+ with open(file, "r") as f:
5
+ lines = f.readlines()
6
+ f.close()
7
+
8
+ D = {}
9
+ for index_genre_pair in lines:
10
+ index, genre = index_genre_pair.split(',')
11
+ D[int(index)] = genre[:-1]
12
+ return D