Spaces:
Build error
Build error
Download app.py from NCTCMumbai/Excel_CSV_Analysis_and_Insights: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/spaces/NCTCMumbai/Excel_CSV_Analysis_and_Insights/resolve/96cfa31a42fac495a6eb61da8e2931fb22598bb8/app.py
- Command line
-
hf download hf://spaces/NCTCMumbai/Excel_CSV_Analysis_and_Insights@96cfa31a42fac495a6eb61da8e2931fb22598bb8/app.py
-
curl -L -o app.py https://huggingface.co/spaces/NCTCMumbai/Excel_CSV_Analysis_and_Insights/resolve/96cfa31a42fac495a6eb61da8e2931fb22598bb8/app.py
506 Bytes
| import pandas as pd | |
| import ydata_profiling | |
| import gradio as gr | |
| from pydantic_settings import BaseSettings | |
| def generate_report(file): | |
| df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file) | |
| report = ydata_profiling.ProfileReport(df) | |
| return report.to_html() | |
| iface = gr.Interface( | |
| generate_report, | |
| [gr.File(file_types=['.csv','.xlsx'], label="Upload a CSV or Excel file")], | |
| "html", | |
| title="Pandas Profiling Report", | |
| live=True, | |
| ) | |
| iface.launch(share=True) |