File size: 382 Bytes
d160281 | 1 2 3 4 5 6 7 8 9 10 11 12 | import pandas as pd
def export_reports_to_excel(reports, file_path):
if not reports:
df = pd.DataFrame(columns=[
"id", "patient_name", "patient_email", "predicted_disease",
"predicted_doctor", "specialization", "confidence", "created_at"
])
else:
df = pd.DataFrame(reports)
df.to_excel(file_path, index=False) |