Skip to content

Instantly share code, notes, and snippets.

@eristoddle
Created April 25, 2016 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eristoddle/1b0bacc471967312078a9cee108459cc to your computer and use it in GitHub Desktop.
Save eristoddle/1b0bacc471967312078a9cee108459cc to your computer and use it in GitHub Desktop.
Merge csvs with Pandas
from glob import iglob
import pandas as pd
files = sorted(iglob('*.csv'))
frames = [ pd.read_csv(f) for f in files ]
result = pd.concat(frames)
final_csv = result.to_csv('./final.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment