dataset / app /writer.py
parthpatel01's picture
Add files using upload-large-folder tool
45a77a4 verified
raw
history blame contribute delete
227 Bytes
from __future__ import annotations
from pathlib import Path
import pandas as pd
def to_excel_safely(df: pd.DataFrame, path: Path) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
df.to_excel(path, index=False)