Blockquote
Help me to read my csv file. I have a csv file test8.csv and I want to read data from that file and put to dict, From the csv file : 1st row is matrices size of value dict that i will create, 2nd row is key of dict and the next is matrix of value of key :
File csv:
1,5
OFFENSE INVOLVING CHILDREN
95
96
35
80
100
2,2
BATTERY,THEFT
173,209
173,224
Output expectation:
dict={['OFFENSE INVOLVING CHILDREN']:
[(95,), (96,), (35,), (80,), (100,)],
['BATTERY', 'THEFT']:[(173, 209), (173, 224)]}
This is my piece of code, and I don't have idea to continue:
_dir = r'D:\s2\semester 3\tesis\phyton\hasil'
with open(os.path.join(_dir, 'test8.csv'), 'rb') as csv_file:
dataReader= csv.reader(csv_file, delimiter=' ', quotechar='|')