Spaces:
Runtime error
Runtime error
ziggycross
commited on
Commit
•
1cddef5
1
Parent(s):
4db793d
Improved sidebar interaction.
Browse files
app.py
CHANGED
@@ -1,44 +1,55 @@
|
|
1 |
import modules
|
2 |
import streamlit as st
|
|
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
uploaded_file = st.sidebar.file_uploader(f"Upload dataset:", type=modules.SUPPORTED_TYPES)
|
7 |
-
st.sidebar.markdown("---")
|
8 |
|
9 |
-
|
10 |
-
drop_missing =
|
11 |
-
remove_duplicates =
|
12 |
-
st.sidebar.markdown("---")
|
13 |
|
14 |
-
|
15 |
-
|
16 |
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
Created by team #2hack2furious for the hackthethreat2023
|
25 |
-
"""
|
26 |
-
)
|
27 |
|
28 |
# Main
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
if df is not None:
|
34 |
-
st.title("Before:")
|
35 |
st.dataframe(df)
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
st.title("After:")
|
40 |
df = modules.data_cleaner(df, drop_missing, remove_duplicates)
|
41 |
st.dataframe(df)
|
42 |
|
43 |
download_file = modules.create_file(df, extension)
|
44 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import modules
|
2 |
import streamlit as st
|
3 |
+
from streamlit_extras.let_it_rain import rain
|
4 |
|
5 |
+
# Options
|
6 |
+
DISCLAIMER = "*Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam urna sem, bibendum efficitur pellentesque a, sollicitudin pharetra urna. Nam vel lectus vitae elit luctus feugiat a a purus. Aenean mollis quis ipsum sed ornare. Nunc sit amet ultricies tellus. Vivamus vulputate sem id molestie viverra. Etiam egestas lobortis enim, sit amet lobortis ligula sollicitudin vel. Nunc eget ipsum sollicitudin, convallis.*"
|
|
|
|
|
7 |
|
8 |
+
# Cleaning parameters
|
9 |
+
drop_missing = None,
|
10 |
+
remove_duplicates = None,
|
|
|
11 |
|
12 |
+
# Anonymizing parameters
|
13 |
+
anonymize_data = None
|
14 |
|
15 |
+
# Page Config
|
16 |
+
st.set_page_config(layout="wide")
|
17 |
|
18 |
+
# Default Sidebar
|
19 |
+
with st.sidebar:
|
20 |
+
st.header("2hack2furious anonymiser",)
|
21 |
+
with st.container() as upload:
|
22 |
+
file = st.file_uploader(f"Upload dataset:", type=modules.SUPPORTED_TYPES)
|
23 |
+
df, (filename, extension), result = modules.load_file(file)
|
|
|
|
|
|
|
24 |
|
25 |
# Main
|
26 |
+
if df is None:
|
27 |
+
rain("🤠")
|
28 |
+
else:
|
|
|
|
|
|
|
29 |
st.dataframe(df)
|
30 |
|
|
|
|
|
|
|
31 |
df = modules.data_cleaner(df, drop_missing, remove_duplicates)
|
32 |
st.dataframe(df)
|
33 |
|
34 |
download_file = modules.create_file(df, extension)
|
35 |
+
with st.sidebar:
|
36 |
+
with st.container() as cleaning_options:
|
37 |
+
st.markdown("Data cleaning options:")
|
38 |
+
drop_missing = st.checkbox("Drop Missing", value=True)
|
39 |
+
remove_duplicates = st.checkbox("Remove Duplicates", value=True)
|
40 |
+
|
41 |
+
with st.container() as anonymizing_options:
|
42 |
+
st.markdown("Anonymizing options:")
|
43 |
+
anonymize_data = st.checkbox("Anonymize data", value=True)
|
44 |
+
|
45 |
+
if df is not None:
|
46 |
+
st.download_button("Download cleaned data", download_file, file_name=filename)
|
47 |
+
|
48 |
+
st.markdown(
|
49 |
+
f"""
|
50 |
+
Disclaimer:
|
51 |
+
{DISCLAIMER}
|
52 |
+
|
53 |
+
Created by team #2hack2furious for the hackthethreat2023
|
54 |
+
"""
|
55 |
+
)
|