Skip to content

Instantly share code, notes, and snippets.

@joseph-allen
Created April 10, 2019 18:39
Show Gist options
  • Save joseph-allen/81b315e463687ad1d82c358c41e9754a to your computer and use it in GitHub Desktop.
Save joseph-allen/81b315e463687ad1d82c358c41e9754a to your computer and use it in GitHub Desktop.
Read multiple files in the same directory
import glob
path = r'path to file' # 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,sep=',|;')
print(filename)
li.append(df)
df = pd.concat(li, axis=0, ignore_index=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment