Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Convert CSVs into Excel sheets
- """
- import glob
- import pandas as pd
- with pd.ExcelWriter("output.xlsx") as writer:
- for file in glob.glob("*.csv"):
- df = pd.read_csv(file)
- df.to_excel(writer, sheet_name=file.replace(".csv", ""), index=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement