Guest User

Untitled

a guest
Jan 23rd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import re
  2. from matplotlib import *
  3.  
  4.  
  5. regex = r'[d]{1,8}, [d]{1,8}'
  6. result = []
  7.  
  8. with
  9. open('data.txt')
  10. as f:
  11. lines = f.readlines()
  12. for line in lines:
  13. match = re.findall(regex, line)
  14. if match != []:
  15. splitted = match[0].split(',')
  16. mapped = list(map(float, splitted))
  17.  
  18. result.append(mapped)
  19.  
  20. # print(result)
  21.  
  22. x, y = result
  23.  
  24. print(x, y)
  25.  
  26. text
  27. text
  28.  
  29. 56, 67
  30. 1002019, 232019
  31.  
  32. 45, 98
  33. 1002009, 232089
  34.  
  35. text
  36. text
  37. text
Add Comment
Please, Sign In to add comment