Skip to content

Instantly share code, notes, and snippets.

@ricklentz
Created June 7, 2017 23:07
Show Gist options
  • Select an option

  • Save ricklentz/2473972a14c295743a0e8005dda0517b to your computer and use it in GitHub Desktop.

Select an option

Save ricklentz/2473972a14c295743a0e8005dda0517b to your computer and use it in GitHub Desktop.
import pandas as pd
import os
path =r'/home/wrk' # use your path
allFiles = os.listdir(path)
frame = pd.DataFrame()
list_ = []
for file_ in allFiles:
df = pd.read_csv(path + '/' + file_,index_col=None, header=0)
list_.append(df)
frame = pd.concat(list_)
frame.to_csv(path + '/comb.csv', sep='\t', encoding='utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment