Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,8 @@ def enhance_section_title(title, icon="✨"):
|
|
62 |
def update_cleaned_data(df):
|
63 |
"""Updates the cleaned data in session state."""
|
64 |
st.session_state.cleaned_data = df
|
65 |
-
st.session_state
|
|
|
66 |
st.success("Action completed successfully!")
|
67 |
|
68 |
def generate_quality_report(df):
|
@@ -359,9 +360,6 @@ with st.sidebar:
|
|
359 |
st.markdown("Created by Calvin Allen-Crawford")
|
360 |
st.markdown("v1.0 | © 2025")
|
361 |
|
362 |
-
# --------------------------
|
363 |
-
# Main App Pages
|
364 |
-
# --------------------------
|
365 |
# --------------------------
|
366 |
# Main App Pages
|
367 |
# --------------------------
|
@@ -623,6 +621,18 @@ elif app_mode == "EDA":
|
|
623 |
|
624 |
if st.session_state.cleaned_data is None:
|
625 |
st.warning("Please clean your data first")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
626 |
st.stop()
|
627 |
|
628 |
df = st.session_state.cleaned_data
|
@@ -849,6 +859,18 @@ elif app_mode == "Model Training":
|
|
849 |
|
850 |
if st.session_state.get("cleaned_data") is None:
|
851 |
st.warning("Please clean your data first")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
852 |
st.stop()
|
853 |
|
854 |
df = st.session_state.cleaned_data
|
|
|
62 |
def update_cleaned_data(df):
|
63 |
"""Updates the cleaned data in session state."""
|
64 |
st.session_state.cleaned_data = df
|
65 |
+
if 'data_versions' in st.session_state:
|
66 |
+
st.session_state.data_versions.append(df.copy())
|
67 |
st.success("Action completed successfully!")
|
68 |
|
69 |
def generate_quality_report(df):
|
|
|
360 |
st.markdown("Created by Calvin Allen-Crawford")
|
361 |
st.markdown("v1.0 | © 2025")
|
362 |
|
|
|
|
|
|
|
363 |
# --------------------------
|
364 |
# Main App Pages
|
365 |
# --------------------------
|
|
|
621 |
|
622 |
if st.session_state.cleaned_data is None:
|
623 |
st.warning("Please clean your data first")
|
624 |
+
# Show Upload Clean Data button
|
625 |
+
uploaded_clean_file = st.file_uploader("Upload your cleaned dataset (CSV/XLSX)", type=["csv", "xlsx"])
|
626 |
+
if uploaded_clean_file:
|
627 |
+
try:
|
628 |
+
if uploaded_clean_file.name.endswith('.csv'):
|
629 |
+
df = pd.read_csv(uploaded_clean_file)
|
630 |
+
else:
|
631 |
+
df = pd.read_excel(uploaded_clean_file)
|
632 |
+
st.session_state.cleaned_data = df
|
633 |
+
st.success("Cleaned data uploaded successfully!")
|
634 |
+
except Exception as e:
|
635 |
+
st.error(f"Error loading file: {str(e)}")
|
636 |
st.stop()
|
637 |
|
638 |
df = st.session_state.cleaned_data
|
|
|
859 |
|
860 |
if st.session_state.get("cleaned_data") is None:
|
861 |
st.warning("Please clean your data first")
|
862 |
+
# Show Upload Clean Data button
|
863 |
+
uploaded_clean_file = st.file_uploader("Upload your cleaned dataset (CSV/XLSX)", type=["csv", "xlsx"])
|
864 |
+
if uploaded_clean_file:
|
865 |
+
try:
|
866 |
+
if uploaded_clean_file.name.endswith('.csv'):
|
867 |
+
df = pd.read_csv(uploaded_clean_file)
|
868 |
+
else:
|
869 |
+
df = pd.read_excel(uploaded_clean_file)
|
870 |
+
st.session_state.cleaned_data = df
|
871 |
+
st.success("Cleaned data uploaded successfully!")
|
872 |
+
except Exception as e:
|
873 |
+
st.error(f"Error loading file: {str(e)}")
|
874 |
st.stop()
|
875 |
|
876 |
df = st.session_state.cleaned_data
|