wenjun99 commited on
Commit
04c0614
·
verified ·
1 Parent(s): 6a96058

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -212,7 +212,9 @@ with tab3:
212
  edited_df = st.data_editor(ef_df, num_rows="dynamic")
213
 
214
  if st.button("Convert to Binary Labels"):
215
- common_cols = list(set(edited_df.columns) & set(thresholds.index))
 
 
216
  numeric_cols = edited_df[common_cols].select_dtypes(include=[np.number]).columns.tolist()
217
 
218
  binary_part = edited_df[numeric_cols].ge(thresholds[numeric_cols]).astype(int)
 
212
  edited_df = st.data_editor(ef_df, num_rows="dynamic")
213
 
214
  if st.button("Convert to Binary Labels"):
215
+ common_cols = list(set(map(int, edited_df.columns)) & set(thresholds.index))
216
+ common_cols = list(map(str, common_cols)) # Convert back to string for use as column names
217
+
218
  numeric_cols = edited_df[common_cols].select_dtypes(include=[np.number]).columns.tolist()
219
 
220
  binary_part = edited_df[numeric_cols].ge(thresholds[numeric_cols]).astype(int)