CosmickVisions commited on
Commit
a25447e
·
verified ·
1 Parent(s): 25d0afd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -299,12 +299,16 @@ elif app_mode == "Smart Cleaning":
299
  st.session_state.current_version += 1
300
  st.experimental_rerun()
301
  dtype_counts = df.dtypes.astype(str).value_counts()
302
- # Data Health Dashboard with Cards
 
303
  st.subheader("📊 Data Health Dashboard")
304
  with st.expander("Show Comprehensive Data Report", expanded=True):
305
- pr = ProfileReport(df, title="Smart Cleaning Data Report") # Add title to pandas profiling report
306
- st_profile_report(pr)
307
-
 
 
 
308
  # Enhanced Health Summary with Cards
309
  col1, col2, col3, col4 = st.columns(4)
310
  with col1:
 
299
  st.session_state.current_version += 1
300
  st.experimental_rerun()
301
  dtype_counts = df.dtypes.astype(str).value_counts()
302
+
303
+ # Data Health Dashboard with Cards
304
  st.subheader("📊 Data Health Dashboard")
305
  with st.expander("Show Comprehensive Data Report", expanded=True):
306
+ try: #Add a try except for the pandas profiling
307
+ pr = ProfileReport(df, title="Cleaned Data Report") # Add title to pandas profiling report
308
+ st_profile_report(pr)
309
+ except ValueError as e:
310
+ st.error(f"Error generating data report: {e}. This can often be caused by an empty or inappropriate dataset. Try checking the dataset or cleaning steps")
311
+ st.stop() #stop to fix
312
  # Enhanced Health Summary with Cards
313
  col1, col2, col3, col4 = st.columns(4)
314
  with col1: