|
|
|
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" |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|