Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import sys
- import csv
- with open("alltextfiles.txt") as file:
- content = file.readlines()
- content = [x.strip() for x in content]
- print (content)
- openedfiles=[]
- readfiles=[]
- x = 0
- for i in content:
- openedfiles.append(i)
- openedfiles[x] = open(i,'r')
- data = openedfiles[x].read()
- fed = np.asarray(data)
- readfiles.append(fed)
- x+=1
- stackedarrays = np.dstack(readfiles)
- print (stackedarrays.sum(axis=2)[1,1])
Add Comment
Please, Sign In to add comment