Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import numpy as np
  2. import csv
  3.  
  4. matrix = np.genfromtxt('matrix.csv', delimiter=';', dtype='int')
  5.  
  6.  
  7. listDict = dict()
  8. with open('list.csv', newline='') as csvfile:
  9.      listfile = csv.reader(csvfile, delimiter=';')
  10.      for row in listfile:
  11.          tempSet = set()
  12.          for i, element in enumerate(row):
  13.             if i != 0:
  14.                 tempSet.add(element)
  15.          listDict[row[0]] = tempSet
  16.  
  17.  
  18. print(listDict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement