Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -430,7 +430,7 @@ elif app_mode == "Data Cleaning":
|
|
430 |
new_df[cols] = new_df[cols].bfill()
|
431 |
|
432 |
update_cleaned_data(new_df)
|
433 |
-
st.
|
434 |
|
435 |
# Data Type Conversion
|
436 |
enhance_section_title("Data Type Conversion", "π")
|
@@ -465,7 +465,7 @@ elif app_mode == "Data Cleaning":
|
|
465 |
new_df[col_to_convert] = pd.to_datetime(new_df[col_to_convert], format=date_format, errors='coerce')
|
466 |
|
467 |
update_cleaned_data(new_df)
|
468 |
-
st.
|
469 |
except Exception as e:
|
470 |
st.error(f"Error: {str(e)}")
|
471 |
|
@@ -478,7 +478,7 @@ elif app_mode == "Data Cleaning":
|
|
478 |
if st.button("Confirm Drop (Columns)"):
|
479 |
new_df = df.drop(columns=columns_to_drop)
|
480 |
update_cleaned_data(new_df)
|
481 |
-
st.
|
482 |
|
483 |
# Label Encoding
|
484 |
enhance_section_title("Label Encoding", "π’")
|
@@ -491,7 +491,7 @@ elif app_mode == "Data Cleaning":
|
|
491 |
le = LabelEncoder()
|
492 |
new_df[col] = le.fit_transform(new_df[col].astype(str))
|
493 |
update_cleaned_data(new_df)
|
494 |
-
st.
|
495 |
|
496 |
# StandardScaler
|
497 |
enhance_section_title("StandardScaler", "π")
|
@@ -503,7 +503,7 @@ elif app_mode == "Data Cleaning":
|
|
503 |
scaler = StandardScaler()
|
504 |
new_df[scale_cols] = scaler.fit_transform(new_df[scale_cols])
|
505 |
update_cleaned_data(new_df)
|
506 |
-
st.
|
507 |
|
508 |
# Pattern-Based Cleaning
|
509 |
enhance_section_title("Pattern-Based Cleaning", "π΅οΈ")
|
@@ -516,7 +516,7 @@ elif app_mode == "Data Cleaning":
|
|
516 |
new_df = df.copy()
|
517 |
new_df[selected_col] = new_df[selected_col].str.replace(pattern, replacement, regex=True)
|
518 |
update_cleaned_data(new_df)
|
519 |
-
st.
|
520 |
|
521 |
enhance_section_title("β¨ Cleaned Data Preview", "β¨")
|
522 |
with st.expander("β¨ Cleaned Data Preview"):
|
|
|
430 |
new_df[cols] = new_df[cols].bfill()
|
431 |
|
432 |
update_cleaned_data(new_df)
|
433 |
+
st.run() # Force re-run after apply
|
434 |
|
435 |
# Data Type Conversion
|
436 |
enhance_section_title("Data Type Conversion", "π")
|
|
|
465 |
new_df[col_to_convert] = pd.to_datetime(new_df[col_to_convert], format=date_format, errors='coerce')
|
466 |
|
467 |
update_cleaned_data(new_df)
|
468 |
+
st.run() # Force re-run after apply
|
469 |
except Exception as e:
|
470 |
st.error(f"Error: {str(e)}")
|
471 |
|
|
|
478 |
if st.button("Confirm Drop (Columns)"):
|
479 |
new_df = df.drop(columns=columns_to_drop)
|
480 |
update_cleaned_data(new_df)
|
481 |
+
st.run() # Force re-run after apply
|
482 |
|
483 |
# Label Encoding
|
484 |
enhance_section_title("Label Encoding", "π’")
|
|
|
491 |
le = LabelEncoder()
|
492 |
new_df[col] = le.fit_transform(new_df[col].astype(str))
|
493 |
update_cleaned_data(new_df)
|
494 |
+
st.run() # Force re-run after apply
|
495 |
|
496 |
# StandardScaler
|
497 |
enhance_section_title("StandardScaler", "π")
|
|
|
503 |
scaler = StandardScaler()
|
504 |
new_df[scale_cols] = scaler.fit_transform(new_df[scale_cols])
|
505 |
update_cleaned_data(new_df)
|
506 |
+
st.run() # Force re-run after apply
|
507 |
|
508 |
# Pattern-Based Cleaning
|
509 |
enhance_section_title("Pattern-Based Cleaning", "π΅οΈ")
|
|
|
516 |
new_df = df.copy()
|
517 |
new_df[selected_col] = new_df[selected_col].str.replace(pattern, replacement, regex=True)
|
518 |
update_cleaned_data(new_df)
|
519 |
+
st.run() # Force re-run after apply
|
520 |
|
521 |
enhance_section_title("β¨ Cleaned Data Preview", "β¨")
|
522 |
with st.expander("β¨ Cleaned Data Preview"):
|