CarisMu commited on
Commit
6b0b935
1 Parent(s): fc75e66

update table style

Browse files
Files changed (1) hide show
  1. results.py +13 -1
results.py CHANGED
@@ -743,7 +743,19 @@ dataset_comparison = pd.DataFrame(
743
  }
744
  )
745
 
746
- table_html = dataset_comparison.to_html(index=False, border=0)
 
 
 
 
 
 
 
 
 
 
 
 
747
  table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
748
 
749
  intro_div = Div(
 
743
  }
744
  )
745
 
746
+ styled_table = (
747
+ dataset_comparison.style.applymap(
748
+ lambda _: "background-color: #E1EEDB", # Green background for "TxT360" and "AnotherColumn"
749
+ subset=pd.IndexSlice[:, ["TxT360 - Upsampling", "TxT360 Difference"]] # Apply to both columns
750
+ )
751
+ .applymap(
752
+ lambda _: "background-color: white", # White background for all other columns
753
+ subset=pd.IndexSlice[:, new_dataset_comparison1.columns.difference(["TxT360 - Upsampling", "TxT360 Difference"])] # Apply to all columns except "TxT360" and "AnotherColumn"
754
+ )
755
+ .hide(axis="index") # Hide the row index
756
+ )
757
+
758
+ table_html = styled_table._repr_html_()
759
  table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
760
 
761
  intro_div = Div(