# Write multiple DataFrames to Excel files
with pd.ExcelWriter('pandas_to_excel.xlsx') as writer:
df.to_excel(writer, sheet_name='sheet1')
df2.to_excel(writer, sheet_name='sheet2')
# Append to an existing Excel file
path = 'pandas_to_excel.xlsx'
with pd.ExcelWriter(path) as writer:
writer.book = openpyxl.load_workbook(path)
df.to_excel(writer, sheet_name='new_sheet1')
df2.to_excel(writer, sheet_name='new_sheet2')
df = pd.concat(pd.read_excel(workbook_url, sheet_name=None), ignore_index=True)
import glob
all_data = pd.DataFrame()
path = 'd:/projects/chassis/data/*.xlsx'
for f in glob.glob(path):
df = pd.read_excel(f, sheet_name=None, ignore_index=True, skiprows=6, usecols=8)
cdf = pd.concat(df.values())
all_data = all_data.append(cdf,ignore_index=True)
print(all_data)