1import sys
2import csv
3import glob
4import pandas as pd
5
6# get data file names
7path =r'C:\DRO\DCL_rawdata_files\excelfiles'
8filenames = glob.glob(path + "/*.xlsx")
9
10dfs = []
11
12for df in dfs:
13 xl_file = pd.ExcelFile(filenames)
14 df=xl_file.parse('Sheet1')
15 dfs.concat(df, ignore_index=True)
1import os
2import pandas as pd
3import openpyxl as excel
4import glob
5
6
7
8#setting up path
9
10path = 'data_inputs'
11extension = 'xlsx'
12os.chdir(path)
13files = [i for i in glob.glob('*.{}'.format(extension))]
14
15#Grouping files - brings multiple files of same type together in a list
16
17wild_groups = ([s for s in files if "wild" in s])
18domestic_groups = ([s for s in files if "domestic" in s])
19
20#Sets up a dictionary associated with the file groupings to be called in another module
21file_names = {"WILD":wild_groups, "DOMESTIC":domestic_groups}
22...
23
1import pandas as pd
2import glob
3
4# your path to folder containing excel files
5datapath = "\\Users\\path\\to\\your\\file\\"
6
7# set all .xls files in your folder to list
8allfiles = glob.glob(datapath + "*.xls")
9
10# for loop to aquire all excel files in folder
11for excelfiles in allfiles:
12 raw_excel = pd.read_excel(excelfiles)
13
14# place dataframe into list
15list1 = [raw_excel]
16