wenjun99 commited on
Commit
4f6586f
·
verified ·
1 Parent(s): 20981db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -254,11 +254,18 @@ with tab3:
254
  st.dataframe(styled)
255
  st.download_button("Download CSV", binary_reordered.to_csv(index=False), "ef_binary_labels.csv")
256
 
257
- # Reconstruct original string from binary values (flatten row-wise)
258
- for i, row in binary_reordered.iterrows():
259
- binary_sequence = row.tolist()
260
- text = binary_labels_to_string(binary_sequence)
261
- st.write(f"Row {i+1} decoded string: {text}")
 
 
 
 
 
 
 
262
 
263
  # # Tab 3: EF → Binary
264
  # with tab3:
 
254
  st.dataframe(styled)
255
  st.download_button("Download CSV", binary_reordered.to_csv(index=False), "ef_binary_labels.csv")
256
 
257
+ # === NEW: Continuous decoding across rows ===
258
+ all_bits = binary_reordered.values.flatten().tolist()
259
+ decoded_string = binary_labels_to_string(all_bits)
260
+ st.subheader("Decoded String (continuous across rows)")
261
+ st.write(decoded_string)
262
+
263
+ # Optional: ascending order output
264
+ binary_ascending = binary_part[[str(h) for h in ascending_input_headers if str(h) in binary_part.columns]]
265
+ st.subheader("Binary Labels (Ascending 3244→4455)")
266
+ st.dataframe(binary_ascending)
267
+ st.download_button("Download Ascending Order CSV", binary_ascending.to_csv(index=False), "ef_binary_labels_ascending.csv")
268
+
269
 
270
  # # Tab 3: EF → Binary
271
  # with tab3: