Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import csv
  2. import numpy as np
  3.  
  4. def read_csv(fileName):
  5.  
  6. with open(fileName) as data:
  7.  
  8. xy = csv.reader(data, delimiter=',')
  9. dim = sum(1 for cc in xy)
  10. x = np.zeros(dim)
  11. y = np.zeros(dim)
  12. data.seek(0)
  13. count = 0
  14. for row in xy:
  15. x[count] = row[0]
  16. y[count] = row[1]
  17. count = count + 1
  18.  
  19. return x,y,count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement