niladridutta commited on
Commit
e13d3fb
·
verified ·
1 Parent(s): 4395af0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -0
app.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import streamlit as st
3
+ import numpy as np
4
+ import pandas as pd
5
+ from ydata_profiling import ProfileReport
6
+
7
+ st.set_page_config(page_title='Automated Data Profiling')
8
+ st.title('AUTOMATED DATA PROFILING')
9
+ st.subheader('Upload your CSV file')
10
+ uploaded_file = st.file_uploader('Choose a CSV file', type={"csv"})
11
+ if uploaded_file is not None:
12
+ st.markdown('---')
13
+ @st.cache_data
14
+ def load_excel(file1):
15
+ df = pd.read_csv(file1, encoding='latin-1')
16
+ return df
17
+ df = load_excel(uploaded_file)
18
+ df = df.replace(np.nan,'',regex=True)
19
+ st.subheader('Data Preview')
20
+ st.dataframe(df.head(20))
21
+
22
+ profile = ProfileReport(df, title="Profiling Report")
23
+ profile.to_file("Profile_Report.html")
24
+
25
+ with open("Profile_Report.html", "rb") as file:
26
+ btn = st.download_button(
27
+ label="Download Profile Report",
28
+ data=file,
29
+ file_name="Profile_Report.html",
30
+ mime="html"
31
+ )
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+