Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -426,7 +426,43 @@ with st.sidebar:
|
|
426 |
# --------------------------
|
427 |
# Main App Pages
|
428 |
# --------------------------
|
429 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
st.title("🧹 Smart Data Cleaning")
|
431 |
|
432 |
if st.session_state.raw_data is None:
|
|
|
426 |
# --------------------------
|
427 |
# Main App Pages
|
428 |
# --------------------------
|
429 |
+
# --------------------------
|
430 |
+
# Main App Pages
|
431 |
+
# --------------------------
|
432 |
+
if app_mode == "Data Upload":
|
433 |
+
st.title("📤 Data Upload & Profiling")
|
434 |
+
|
435 |
+
uploaded_file = st.file_uploader("Upload your dataset (CSV/XLSX)", type=["csv", "xlsx"])
|
436 |
+
|
437 |
+
if uploaded_file:
|
438 |
+
try:
|
439 |
+
if uploaded_file.name.endswith('.csv'):
|
440 |
+
df = pd.read_csv(uploaded_file)
|
441 |
+
else:
|
442 |
+
df = pd.read_excel(uploaded_file)
|
443 |
+
|
444 |
+
st.session_state.raw_data = df
|
445 |
+
|
446 |
+
col1, col2, col3 = st.columns(3)
|
447 |
+
with col1:
|
448 |
+
st.metric("Rows", df.shape[0])
|
449 |
+
with col2:
|
450 |
+
st.metric("Columns", df.shape[1])
|
451 |
+
with col3:
|
452 |
+
st.metric("Missing Values", df.isna().sum().sum())
|
453 |
+
|
454 |
+
with st.expander("Data Preview", expanded=True):
|
455 |
+
st.dataframe(df.head(10), use_container_width=True)
|
456 |
+
|
457 |
+
if st.button("Generate Full Profile Report"):
|
458 |
+
with st.spinner("Generating comprehensive analysis..."):
|
459 |
+
pr = ProfileReport(df, explorative=True)
|
460 |
+
st_profile_report(pr)
|
461 |
+
|
462 |
+
except Exception as e:
|
463 |
+
st.error(f"Error loading file: {str(e)}")
|
464 |
+
|
465 |
+
elif app_mode == "Data Cleaning":
|
466 |
st.title("🧹 Smart Data Cleaning")
|
467 |
|
468 |
if st.session_state.raw_data is None:
|