0

Now I am reading many files in this manner in 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"]))

instead i want to import a single file comprising all the files as sheets. in regular pandas i will use the below code.

df= (pd.read_excel(io=file_name,sheet_name='Sheet1'))

Can some one tell how to to the same in google colab.

1 Answers1

0

i didn't find the exact solution but a similar way instead of manually importing the single file every time, select all file at time and upload. reading will happen individually on file names as below.

data=files.upload()

line=pd.read_excel(io.BytesIO(data["line fixing.xls"]))
kg=pd.read_excel(io.BytesIO(data["kg fixing.xls"]))
vol=pd.read_excel(io.BytesIO(data["vol  fixing.xls"]))
Master=pd.read_excel(io.BytesIO(data["Volume_Pallet.xls"]))
area=pd.read_excel(io.BytesIO(data["area fixing.xls"]))
Format_out=pd.read_excel(io.BytesIO(data["Formate_output.xls"]))
pallet_num=pd.read_excel(io.BytesIO(data["Pallet_number.xls"]))