-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
77 lines (68 loc) · 2.74 KB
/
main.py
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import numpy as np
import pandas as pd
import streamlit as st
from pandas_profiling import ProfileReport
from streamlit_pandas_profiling import st_profile_report
def main():
html_temp1 = """<div>
<h4 >Exploratory data Analysis Automator</h4>
</div>
</br>"""
st.markdown(html_temp1, unsafe_allow_html=True)
menu = ["Home", "EDA", "About"]
choice = st.sidebar.selectbox("Menu", menu, 2)
# for hide menu
hide_streamlit_style = """
<style>
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
</style>
"""
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
st.sidebar.markdown(
""" Developed by Komali Beeram """)
if choice == "Home":
html_temp2 = """<div>
<h4>This is the Exploratory data Analysis Automator created using Streamlit framework and pandas-profiling library.</h4>
</div>
</br>"""
st.markdown(html_temp2, unsafe_allow_html=True)
elif choice == "EDA":
html_temp3 = """<div>
<h4 >Upload file Your file in csv formate and perform Exploratory Data Analysis</h4>
<h5 >Make sure your columns have correct data types before uploading.</h5>
</div>
<br></br>"""
st.markdown(html_temp3, unsafe_allow_html=True)
st.subheader("Perform Exploratory data Analysis with Pandas Profiling Library")
data_file= st.file_uploader("Upload a csv file", type=["csv"])
if st.button("Analyze"):
if data_file is not None:
# Pandas Profiling Report
@st.cache
def load_csv():
csv = pd.read_csv(data_file)
return csv
df = load_csv()
pr = ProfileReport(df, explorative=True)
st.header('*User Input DataFrame*')
st.write(df)
st.write('---')
st.header('*Exploratory Data Analysis Report Using Pandas Profiling*')
st_profile_report(pr)
else:
st.success("Upload file")
else:
pass
elif choice == "About":
html_temp4 = """
<div>
<h4>This Application is developed by Komali Beeram using Streamlit Framework for The Mentor.</h4>
</div>
<br></br>
<br></br>"""
st.markdown(html_temp4, unsafe_allow_html=True)
else:
pass
if __name__ == "__main__":
main()