1
Good Night, please help me with the question below?
I am developing a program that reads all csv’s with the same content of a folder and consoles them in a single file, disregarding the first line, but when executing the code below the final file has no data one under the other and rather next to each other, how can I correct?
Final file: Date,Name,Value,Date,Name,Value,Date,Name,Value,Date,Name,Value,Date,Name,Value,Date,Name,Value,Date,Date,Name,Value, 01/01/2020,Test,1,01/01/2020,Test,1,01/01/2020,Test,1,01/01/2020,Test,1,01/01/2020,Test,1,01/01/2020,Test,1,01/01/2020,Test,1
import pandas as pd
import numpy as np
diretorio = "C:/Users...{}"
consolidado = []
for i in lista_arquivos:
consolidado.append(pd.read_csv(diretorio.format(i), sep=';'))
arq_consolidado = pd.concat(consolidado, axis=1, join='inner').sort_index()
arq_consolidado.to_csv(r'C:\Users...arq_consolidado.csv', index = False)
Thank you Cainan I used this compression and it worked super well!
– Letícia Araujo