Download backend/utils/excel_export.py from Nausad/AI_Doc: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/spaces/Nausad/AI_Doc/resolve/main/backend/utils/excel_export.py
- Command line
-
hf download hf://spaces/Nausad/AI_Doc/backend/utils/excel_export.py
-
curl -L -o excel_export.py https://huggingface.co/spaces/Nausad/AI_Doc/resolve/main/backend/utils/excel_export.py
382 Bytes
| 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) |