Created
April 10, 2019 18:39
-
-
Save joseph-allen/81b315e463687ad1d82c358c41e9754a to your computer and use it in GitHub Desktop.
Read multiple files in the same directory
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
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