Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import csv
- matrix = np.genfromtxt('matrix.csv', delimiter=';', dtype='int')
- listDict = dict()
- with open('list.csv', newline='') as csvfile:
- listfile = csv.reader(csvfile, delimiter=';')
- for row in listfile:
- tempSet = set()
- for i, element in enumerate(row):
- if i != 0:
- tempSet.add(element)
- listDict[row[0]] = tempSet
- print(listDict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement