Commit
•
0a5d39a
1
Parent(s):
a2f6df1
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import pandas_profiling
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def generate_report(file):
|
6 |
+
df = pd.read_csv(file) if file.name.endswith(".csv") else pd.read_excel(file)
|
7 |
+
report = pandas_profiling.ProfileReport(df)
|
8 |
+
return report.to_html()
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
generate_report,
|
12 |
+
[gr.File(accept=".csv,.xlsx", label="Upload a CSV or Excel file")],
|
13 |
+
"html",
|
14 |
+
title="Pandas Profiling Report",
|
15 |
+
live=True,
|
16 |
+
)
|
17 |
+
|
18 |
+
iface.launch(share=True)
|