Spaces:
Runtime error
Runtime error
update the first table
Browse files
main.py
CHANGED
|
@@ -476,23 +476,38 @@ new_dataset_comparison1 = pd.DataFrame(
|
|
| 476 |
)
|
| 477 |
|
| 478 |
|
| 479 |
-
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 480 |
styled_table = (
|
| 481 |
new_dataset_comparison1.style.set_properties(
|
| 482 |
-
**{"background-color": "#E1EEDB"},
|
| 483 |
-
subset=pd.IndexSlice[0
|
| 484 |
)
|
| 485 |
.apply(
|
| 486 |
lambda x: [
|
| 487 |
-
"background-color:
|
| 488 |
-
|
| 489 |
-
else "background-color: rgb(237, 242, 251)" # Blue background for other rows
|
| 490 |
-
for i in range(len(x))
|
| 491 |
],
|
| 492 |
-
axis=
|
| 493 |
)
|
| 494 |
-
.hide(axis="index")
|
| 495 |
-
)
|
| 496 |
|
| 497 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 498 |
table_html = styled_table._repr_html_()
|
|
|
|
| 476 |
)
|
| 477 |
|
| 478 |
|
| 479 |
+
# # Apply table styling: Light green for the header, alternating white and light grey for rows
|
| 480 |
+
# styled_table = (
|
| 481 |
+
# new_dataset_comparison1.style.set_properties(
|
| 482 |
+
# **{"background-color": "#E1EEDB"},
|
| 483 |
+
# subset=pd.IndexSlice[0, :], # Row 0 with a light green background
|
| 484 |
+
# )
|
| 485 |
+
# .apply(
|
| 486 |
+
# lambda x: [
|
| 487 |
+
# "background-color: #E1EEDB" # Green background for row 0
|
| 488 |
+
# if i == 0
|
| 489 |
+
# else "background-color: rgb(237, 242, 251)" # Blue background for other rows
|
| 490 |
+
# for i in range(len(x))
|
| 491 |
+
# ],
|
| 492 |
+
# axis=0,
|
| 493 |
+
# )
|
| 494 |
+
# .hide(axis="index")
|
| 495 |
+
# ) # Hide the row index
|
| 496 |
+
|
| 497 |
styled_table = (
|
| 498 |
new_dataset_comparison1.style.set_properties(
|
| 499 |
+
**{"background-color": "#E1EEDB"}, # Set col 1 with a green background
|
| 500 |
+
subset=pd.IndexSlice[:, 0], # Apply green to all rows of column 1
|
| 501 |
)
|
| 502 |
.apply(
|
| 503 |
lambda x: [
|
| 504 |
+
"background-color: white" # White background for other columns
|
| 505 |
+
for _ in range(len(x))
|
|
|
|
|
|
|
| 506 |
],
|
| 507 |
+
axis=1,
|
| 508 |
)
|
| 509 |
+
.hide(axis="index") # Hide the row index
|
| 510 |
+
)
|
| 511 |
|
| 512 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
| 513 |
table_html = styled_table._repr_html_()
|