【发布时间】:2020-12-26 15:32:28
【问题描述】:
现在我在 Google colab 中以这种方式读取许多文件。
linedata=files.upload()
kgdata=files.upload()
voldata=files.upload()
Masterdata=files.upload()
areadata=files.upload()
Format_out_data=files.upload()
pallet_num_data=files.upload()
line=pd.read_excel(io.BytesIO(linedata["line fixing.xls"]))
kg=pd.read_excel(io.BytesIO(kgdata["kg fixing.xls"]))
vol=pd.read_excel(io.BytesIO(voldata["vol fixing.xls"]))
Master=pd.read_excel(io.BytesIO(Masterdata["Volume_Pallet.xls"]))
area=pd.read_excel(io.BytesIO(areadata["area fixing.xls"]))
Format_out=pd.read_excel(io.BytesIO(Format_out_data["Formate_output.xls"]))
pallet_num=pd.read_excel(io.BytesIO(pallet_num_data["Pallet_number.xls"]))
相反,我想导入一个包含所有文件的单个文件作为工作表。在普通熊猫中,我将使用以下代码。
df= (pd.read_excel(io=file_name,sheet_name='Sheet1'))
有人可以告诉如何在 google colab 中进行相同的操作吗?
【问题讨论】:
-
我在另一篇文章中举了一个例子:stackoverflow.com/a/66280555/778261
标签: excel pandas csv google-colaboratory import-from-excel