I'm trying to put two columns of data, each one in a different file with the names you'll see in the code, in a single file as two columns side by side. The error, quoted in the title ("list out of the range") always appears where I will indicate with an asterisk in the code. Can you help me?
Normally this error appears when I call a data that is not in a vector or exceeds the size of the vector (??? I think ???) but in the case I am creating a vector and assigning data to it ne. In the case a same matrix. * I already tried to do so by adding the values (ex a + b) to see if the two were next to each other as a concatenation of a text and did not work, then I do not know anymore. I went to try this matrix and I could not finally ... help me!
arquivo1 = open ("bandaIZ_coluna5_dados_não_saturados.txt","r")
dados1 = arquivo1.readlines()
arquivo1.close()
arquivo2 = open ("bandaIZ_coluna13_dados_não_saturados.txt","r")
dados2 = arquivo2.readlines()
arquivo2.close()
arquivo3 = open ("bandaIZ_colunas13&5","w")
if(len(dados1) == len(dados2)):
print("len(dados1) == len(dados2)")
i = 0
d = []
while(i < len(dados1)):
d2 = (dados2[i])
d1 = (dados1[i])
d[i][0] = d2
d[i][1] = d1
i=i+1
arquivo3.write(d)
arquivo3.close()