Skip to content

Instantly share code, notes, and snippets.

@cmpadden
Created August 7, 2019 18:08
Show Gist options
  • Select an option

  • Save cmpadden/f73ba9cdc5bf9e9eb8d46d96db25beb2 to your computer and use it in GitHub Desktop.

Select an option

Save cmpadden/f73ba9cdc5bf9e9eb8d46d96db25beb2 to your computer and use it in GitHub Desktop.
Convert CSVs into Excel Worksheet Tabs
"""
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment