fork download
  1. import numpy as np
  2. #Simula um conjunto de arquivos para teste...
  3. from io import StringIO
  4.  
  5. d = {
  6. "day_0.txt": StringIO("1,0\n1.0404,-1\n0,1.53"),
  7. "day_1.txt": StringIO("1,0.73\n1.4827,0\n1,0")
  8. }
  9. #...fim da simulação.
  10.  
  11.  
  12. X = np.zeros((2, 2))
  13. for n in range(0,2):
  14. X[n] = tuple(map(max, abs(np.loadtxt(d['day_'+str(n)+'.txt'], delimiter=",", unpack=True))))
  15.  
  16. print(X)
Success #stdin #stdout 0.22s 27296KB
stdin
Standard input is empty
stdout
[[1.0404 1.53  ]
 [1.4827 0.73  ]]