0

I want to join several csv files together from a single folder and have implemented this code. It loops on my files, created the output file, but doesn't save any values in it. Here is my code.

import glob
import pandas as pd
def appenddf():

    directoryPath= 'C:\\Users\\m3njh9\\4tabfiles'

    glued_data = pd.DataFrame()
    for file_name in glob.glob(directoryPath+'*.csv'):
        x = pd.read_csv(file_name, low_memory=False, sheet_name =1)
        glued_data = glued_data.append(x, ignore_index=True, sort=False)
    
 
    glued_data.to_excel('Resultjoined.xlsx', sheet_name = 'Foundry Customer')
    glued_data.dropna(how='all')
    return glued_data
    
    
   

Can you help me understanq what's wrong? Thanks in advance

0 Answers0