I'm trying to copy over an excel document, however it only seems to copy over the first sheet and not copy over the sheet names either from the original file.
I've tried to copy it and when that failed I looked up how to do it, however, the issue is that I will not know what the sheet names are prior to use nor how many are there.
import pandas as pd
import numpy as np
from shutil import copyfile
copyfile(loc, tLoc)
wdf = pd.read_excel(tLoc , index_col=[0])
sheet_wdf_map = pd.read_excel(tLoc, sheet_name=None)
print(wdf.head())
wdf['Adequate'] = np.nan
wdf['Explanation'] = np.nan
wdf.to_excel(tLoc)
I'd expect it to copy over the entire file verbatim including all the sheets however it does not. If there is a solution involved in not copying it over into an empty preexisting file instead of a new file that would also work. Thanks!