Guest User

Untitled

a guest
Jun 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import numpy as np
  2. import sys
  3. import csv
  4.  
  5. with open("alltextfiles.txt") as file:
  6. content = file.readlines()
  7. content = [x.strip() for x in content]
  8. print (content)
  9.  
  10. openedfiles=[]
  11. readfiles=[]
  12. x = 0
  13. for i in content:
  14. openedfiles.append(i)
  15. openedfiles[x] = open(i,'r')
  16. data = openedfiles[x].read()
  17. fed = np.asarray(data)
  18. readfiles.append(fed)
  19. x+=1
  20. stackedarrays = np.dstack(readfiles)
  21.  
  22. print (stackedarrays.sum(axis=2)[1,1])
Add Comment
Please, Sign In to add comment