Created
April 25, 2016 17:49
-
-
Save eristoddle/1b0bacc471967312078a9cee108459cc to your computer and use it in GitHub Desktop.
Merge csvs with Pandas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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