mhamza-007's picture
Upload 8 files
0104e91 verified
Raw
History Blame Contribute Delete
311 Bytes
"""Writing datasets back to disk."""
from pathlib import Path
def save_dataframe(df, path, index=False):
"""Write ``df`` to an Excel file, creating the parent folder if needed."""
path = Path(path)
path.parent.mkdir(parents=True, exist_ok=True)
df.to_excel(path, index=index)
return path