Spaces:
Running
Running
Jellyfish042
commited on
Commit
·
54696b7
1
Parent(s):
b249e77
update
Browse files
app.py
CHANGED
@@ -164,6 +164,9 @@ def update_table(period: str,
|
|
164 |
formatter = {col: "{:.3f}" for col in filtered_data.columns if
|
165 |
filtered_data[col].dtype in ['float64', 'float32']}
|
166 |
|
|
|
|
|
|
|
167 |
# color gradient
|
168 |
colors = ["#63be7b", "#ffffff", "#f8696b"]
|
169 |
cmap = LinearSegmentedColormap.from_list("custom_cmap", colors)
|
@@ -176,7 +179,7 @@ def update_table(period: str,
|
|
176 |
styler = filtered_data.style.format(formatter).background_gradient(
|
177 |
cmap=cmap,
|
178 |
subset=target_color_columns
|
179 |
-
)
|
180 |
|
181 |
return styler
|
182 |
else:
|
|
|
164 |
formatter = {col: "{:.3f}" for col in filtered_data.columns if
|
165 |
filtered_data[col].dtype in ['float64', 'float32']}
|
166 |
|
167 |
+
def color_column(s):
|
168 |
+
return ['background-color: #fffdd0' if pd.notna(x) else 'default' for x in s]
|
169 |
+
|
170 |
# color gradient
|
171 |
colors = ["#63be7b", "#ffffff", "#f8696b"]
|
172 |
cmap = LinearSegmentedColormap.from_list("custom_cmap", colors)
|
|
|
179 |
styler = filtered_data.style.format(formatter).background_gradient(
|
180 |
cmap=cmap,
|
181 |
subset=target_color_columns
|
182 |
+
).apply(color_column, subset=['Parameters Count (B)'])
|
183 |
|
184 |
return styler
|
185 |
else:
|