panda menambahkan file csv a
df.to_csv('my_csv.csv', mode='a', header=False)
Faithful Fox
df.to_csv('my_csv.csv', mode='a', header=False)
df.to_csv('my_csv.csv', mode='a', header=False)
import pandas as pd
import glob
path = r'C:\DRO\DCL_rawdata_files' # use your path
all_files = glob.glob(path + "/*.csv")
li = []
for filename in all_files:
df = pd.read_csv(filename, index_col=None, header=0)
li.append(df)
frame = pd.concat(li, axis=0, ignore_index=True)
# append with mode = 'a'
# no header for existing files this way
output_path='my_csv.csv'
df.to_csv(output_path, mode='a', header=not os.path.exists(output_path))