Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -376,7 +376,7 @@ dataset_comparison2 = pd.DataFrame(
|
|
| 376 |
}
|
| 377 |
)
|
| 378 |
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
| 379 |
-
styled_table =
|
| 380 |
**{'background-color': 'rgb(234, 255, 241)'}, subset=pd.IndexSlice[0,:]
|
| 381 |
).apply(
|
| 382 |
lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
|
|
@@ -384,7 +384,7 @@ styled_table = dataset_comparison1.style.set_properties(
|
|
| 384 |
)
|
| 385 |
|
| 386 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 387 |
-
|
| 388 |
# table_html2 = dataset_comparison2.to_html(index=False, border=0)
|
| 389 |
table_div_2 = Div(NotStr(table_html2), style="margin: 40px;")
|
| 390 |
|
|
@@ -445,11 +445,11 @@ dataset_sources = pd.DataFrame(
|
|
| 445 |
}
|
| 446 |
)
|
| 447 |
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
| 448 |
-
styled_table =
|
| 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 |
-
|
| 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 |
|
|
|
|
| 376 |
}
|
| 377 |
)
|
| 378 |
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
| 379 |
+
styled_table = dataset_comparison2.style.set_properties(
|
| 380 |
**{'background-color': 'rgb(234, 255, 241)'}, subset=pd.IndexSlice[0,:]
|
| 381 |
).apply(
|
| 382 |
lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(len(x))],
|
|
|
|
| 384 |
)
|
| 385 |
|
| 386 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 387 |
+
table_html2 = 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 |
|
|
|
|
| 445 |
}
|
| 446 |
)
|
| 447 |
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
| 448 |
+
styled_table = dataset_sources.style.apply(
|
| 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_data = 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 |
|