from pathlib import Path import pandas as pd output = Path("exports/orders.csv") output.parent.mkdir(parents=True, exist_ok=True) orders = pd.DataFrame( { "order_id": pd.Series(["A100", "A101", "A102"], dtype="string"), "customer": ["Ada Lovelace", "Lin Chen", "Maya Patel"], "region": ["EMEA", "APAC", "AMER"], "total_usd": [149.5, None, 212.0], "ordered_at": pd.to_datetime( ["2026-06-01", "2026-06-02", "2026-06-03"] ), } ) orders.to_csv( output, sep=",", index=False, columns=["order_id", "customer", "region", "total_usd", "ordered_at"], na_rep="", float_format="%.2f", date_format="%Y-%m-%d", encoding="utf-8", lineterminator="\n", ) print(f"Wrote {output}")