File size: 1,010 Bytes
e13d3fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
59

import streamlit as st
import numpy as np
import pandas as pd
from ydata_profiling import ProfileReport

st.set_page_config(page_title='Automated Data Profiling')
st.title('AUTOMATED DATA PROFILING')
st.subheader('Upload your CSV file')
uploaded_file = st.file_uploader('Choose a CSV file', type={"csv"})
if uploaded_file is not None:
    st.markdown('---')
    @st.cache_data
    def load_excel(file1):
            df = pd.read_csv(file1, encoding='latin-1')
            return df
    df = load_excel(uploaded_file)
    df = df.replace(np.nan,'',regex=True)
    st.subheader('Data Preview')
    st.dataframe(df.head(20))

    profile = ProfileReport(df, title="Profiling Report")
    profile.to_file("Profile_Report.html")

    with open("Profile_Report.html", "rb") as file:
        btn = st.download_button(
                label="Download Profile Report",
                data=file,
                file_name="Profile_Report.html",
                mime="html"
            )