Advertisement
elena1234

create multiple excel sheets

Nov 23rd, 2022 (edited)
834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | Source Code | 0 0
  1. writer = pd.ExcelWriter('auto.bg.xlsx', engine='openpyxl')
  2. df_diesel.to_excel(writer, sheet_name='Diesel engines')
  3. df_gasoline.to_excel(writer, sheet_name='Gasoline engines')
  4. df_electric.to_excel(writer, sheet_name='Electric engines')
  5. df_hybrid.to_excel(writer, sheet_name='Hybrid engines')
  6. writer.save()
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement