Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to concat csv files python

import pandas as pd
import glob
import os

# setting the path for joining multiple files


# list of merged files returned
files = glob.glob('/*.csv')

print("Resultant CSV after joining all CSV files at a particular location...");

# joining files with concat and read_csv
df = pd.concat(map(pd.read_csv, files), ignore_index=True)
print(df)
 
PREVIOUS NEXT
Tagged: #concat #csv #files #python
ADD COMMENT
Topic
Name
1+7 =