I want to fill an empty dataframe with data in csv files by using a loop. The code works fine except that each time the dataframe records only the last csv file and not all the csv files that exist in the destination folder.
Did I do something wrong?
Here is a piece of my code :
csv_files = glob.glob(path +"/*.csv")
for csv_file in csv_files:
columns_name = [A,B,C,D]
newDF = pd.DataFrame( columns=columns_name)
newDF = pd.concat([newDF,df])
newDF.fillna('unknown', inplace=True)