Spaces:
Runtime error
Runtime error
ziggycross
commited on
Commit
•
4db793d
1
Parent(s):
3b7db7f
Moved controls to sidebar.
Browse files
app.py
CHANGED
@@ -1,16 +1,31 @@
|
|
1 |
import modules
|
2 |
-
import pandas as pd
|
3 |
import streamlit as st
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
"""
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
"""
|
11 |
-
)
|
12 |
|
13 |
-
|
14 |
|
15 |
df, (filename, extension), result = modules.load_file(uploaded_file)
|
16 |
st.text(result)
|
@@ -19,15 +34,11 @@ if df is not None:
|
|
19 |
st.title("Before:")
|
20 |
st.dataframe(df)
|
21 |
|
22 |
-
|
23 |
-
remove_duplicates = st.checkbox("Remove Duplicates", True)
|
24 |
|
25 |
st.title("After:")
|
26 |
df = modules.data_cleaner(df, drop_missing, remove_duplicates)
|
27 |
st.dataframe(df)
|
28 |
|
29 |
download_file = modules.create_file(df, extension)
|
30 |
-
st.download_button("Download cleaned data", download_file, file_name=filename)
|
31 |
-
|
32 |
-
st.markdown("---")
|
33 |
-
st.text("Created by team #2hack2furious for the hackthethreat2023")
|
|
|
1 |
import modules
|
|
|
2 |
import streamlit as st
|
3 |
|
4 |
+
# Sidebar
|
5 |
+
st.sidebar.header("2hack2furious anonymiser")
|
6 |
+
uploaded_file = st.sidebar.file_uploader(f"Upload dataset:", type=modules.SUPPORTED_TYPES)
|
7 |
+
st.sidebar.markdown("---")
|
8 |
+
|
9 |
+
st.sidebar.text("Data cleaning options:")
|
10 |
+
drop_missing = st.sidebar.checkbox("Drop Missing", True)
|
11 |
+
remove_duplicates = st.sidebar.checkbox("Remove Duplicates", True)
|
12 |
+
st.sidebar.markdown("---")
|
13 |
+
|
14 |
+
st.sidebar.text("Data anonymizing options:")
|
15 |
+
st.sidebar.markdown("---")
|
16 |
+
|
17 |
+
|
18 |
+
st.sidebar.markdown(
|
19 |
"""
|
20 |
+
Disclaimer:
|
21 |
+
|
22 |
+
*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.*
|
23 |
+
|
24 |
+
Created by team #2hack2furious for the hackthethreat2023
|
25 |
"""
|
26 |
+
)
|
27 |
|
28 |
+
# Main
|
29 |
|
30 |
df, (filename, extension), result = modules.load_file(uploaded_file)
|
31 |
st.text(result)
|
|
|
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.download_button("Download cleaned data", download_file, file_name=filename)
|
|
|
|
|
|