我正在尝试将多个Excel文件读入Pandas Dataframe。
我已经准备好了以下代码:
allFiles = glob.glob(base2 + "/*.xls"). <<-- Reading from path where all files are stored
list_ = []
for file_ in allFiles:
df = pd.read_excel(io.BytesIO(open(file_, 'rb').read()), sheet_name='Sheet1') <<-- using io module to read the file as there are some issue with the text format
list_.append(df)
print(list_)
file = pd.DataFrame(list_)
当我打开Dataframe csv文件时,我会在单个行中看到单个文件的全部内容。我试图让源文件中的每一行都在文件输出的单独一行中说。