Advertisement
DeaD_EyE

csv ... ungetestet

Sep 3rd, 2020
1,645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from collections import defaultdict
  2.  
  3.  
  4. names = {
  5.     "wall_top": "Wall_top_position.csv",
  6.     "wall_bot": "Wall_bot_position.csv",
  7.     "membrane_top": "Membrane_top.csv",
  8.     "membrane_bot": "Membrane_bot.csv",
  9. }
  10.  
  11. results = defaultdict(list)
  12.  
  13.  
  14. for name, file in names.items():
  15.     with open(file) as fd:
  16.         reader = csv.reader(fd)
  17.         for row in reader:
  18.             results[name].append(row[5:7])
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement