DeaD_EyE

csv ... ungetestet

Sep 3rd, 2020
1,217
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
RAW Paste Data