Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -289,11 +289,11 @@ dataset_comparison1 = pd.DataFrame(
|
|
289 |
|
290 |
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
291 |
styled_table = dataset_comparison1.style.set_properties(
|
292 |
-
**{'background-color': '
|
293 |
).apply(
|
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_()
|
@@ -377,11 +377,11 @@ dataset_comparison2 = pd.DataFrame(
|
|
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 |
-
|
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))],
|
383 |
axis=0
|
384 |
-
)
|
385 |
|
386 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
387 |
table_html2 = styled_table._repr_html_()
|
@@ -448,7 +448,8 @@ dataset_sources = pd.DataFrame(
|
|
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;")
|
|
|
289 |
|
290 |
# Apply table styling: Light green for the header, alternating white and light grey for rows
|
291 |
styled_table = dataset_comparison1.style.set_properties(
|
292 |
+
**{'background-color': '#E1EEDB'}, subset=pd.IndexSlice[0,:] # Row 0 with a light yellow background
|
293 |
).apply(
|
294 |
+
lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(1, len(x))],
|
295 |
axis=0
|
296 |
+
).hide(axis="index") # Hide the row index
|
297 |
|
298 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
299 |
table_html = styled_table._repr_html_()
|
|
|
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': '#E1EEDB'}, subset=pd.IndexSlice[0,:] # Row 0 with a light yellow background
|
381 |
).apply(
|
382 |
+
lambda x: ['background-color: white' if i % 2 == 0 else 'background-color: rgb(237, 242, 251)' for i in range(1, len(x))],
|
383 |
axis=0
|
384 |
+
).hide(axis="index") # Hide the row index
|
385 |
|
386 |
# Use _repr_html_() method to get the HTML representation of the styled DataFrame
|
387 |
table_html2 = styled_table._repr_html_()
|
|
|
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 |
+
).hide(axis="index") # Hide the row index
|
452 |
+
|
453 |
table_html_data = styled_table._repr_html_()
|
454 |
# table_html_data = dataset_sources.to_html(index=False, border=0)
|
455 |
table_div_data = Div(NotStr(table_html_data), style="margin: 40px;")
|