CarisMu commited on
Commit
b6d74c9
1 Parent(s): 140edc3

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -3
main.py CHANGED
@@ -294,7 +294,9 @@ styled_table = dataset_comparison1.style.set_properties(
294
  lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
295
  axis=0
296
  )
297
- table_html = styled_table.render()
 
 
298
  # table_html = dataset_comparison1.to_html(index=False, border=0)
299
  table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
300
 
@@ -380,7 +382,9 @@ styled_table = dataset_comparison1.style.set_properties(
380
  lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
381
  axis=0
382
  )
383
- table_html = styled_table.render()
 
 
384
  # table_html2 = dataset_comparison2.to_html(index=False, border=0)
385
  table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
386
 
@@ -445,7 +449,7 @@ styled_table = dataset_comparison1.style.apply(
445
  lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
446
  axis=0
447
  )
448
- table_html = styled_table.render()
449
  # table_html_data = dataset_sources.to_html(index=False, border=0)
450
  table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
451
 
 
294
  lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
295
  axis=0
296
  )
297
+
298
+ # Use _repr_html_() method to get the HTML representation of the styled DataFrame
299
+ table_html = styled_table._repr_html_()
300
  # table_html = dataset_comparison1.to_html(index=False, border=0)
301
  table_div_1 = Div(NotStr(table_html), style="margin: 40px;")
302
 
 
382
  lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
383
  axis=0
384
  )
385
+
386
+ # Use _repr_html_() method to get the HTML representation of the styled DataFrame
387
+ table_html = styled_table._repr_html_()
388
  # table_html2 = dataset_comparison2.to_html(index=False, border=0)
389
  table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
390
 
 
449
  lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
450
  axis=0
451
  )
452
+ table_html = styled_table._repr_html_()
453
  # table_html_data = dataset_sources.to_html(index=False, border=0)
454
  table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
455