Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -446,6 +446,13 @@ def server(input, output, session):
|
|
| 446 |
'z0': 'vRel',
|
| 447 |
'tj_stuff_plus': 'tjStuff+'
|
| 448 |
}))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
|
| 450 |
# brushed_df_final = brushed_df_final
|
| 451 |
|
|
@@ -457,7 +464,7 @@ def server(input, output, session):
|
|
| 457 |
else:
|
| 458 |
''
|
| 459 |
return "font-weight: bold;"
|
| 460 |
-
|
| 461 |
df_brush_style = (brushed_df_final.to_pandas().style.set_precision(1)
|
| 462 |
|
| 463 |
.set_properties(**{'border': '3 px'},overwrite=False).set_table_styles([{
|
|
@@ -495,6 +502,7 @@ def server(input, output, session):
|
|
| 495 |
.set_table_styles([{'selector': 'thead th:nth-child(8)', 'props': [('min-width', '40px')]}], overwrite=False)
|
| 496 |
.background_gradient(cmap=cmap_sum,subset = (brushed_df_final.columns[-1]),vmin=80,vmax=120)
|
| 497 |
.applymap(lambda x: f'background-color: {dict_pitch_name.get(x, "")}', subset=['Pitch Type'])
|
|
|
|
| 498 |
|
| 499 |
|
| 500 |
)
|
|
|
|
| 446 |
'z0': 'vRel',
|
| 447 |
'tj_stuff_plus': 'tjStuff+'
|
| 448 |
}))
|
| 449 |
+
brushed_df_final = brushed_df_final.with_columns(
|
| 450 |
+
pl.when(pl.col("Spin").is_not_null())
|
| 451 |
+
.then(pl.col("Spin").round(0))
|
| 452 |
+
.otherwise(0)
|
| 453 |
+
.alias("Spin")
|
| 454 |
+
)
|
| 455 |
+
|
| 456 |
|
| 457 |
# brushed_df_final = brushed_df_final
|
| 458 |
|
|
|
|
| 464 |
else:
|
| 465 |
''
|
| 466 |
return "font-weight: bold;"
|
| 467 |
+
|
| 468 |
df_brush_style = (brushed_df_final.to_pandas().style.set_precision(1)
|
| 469 |
|
| 470 |
.set_properties(**{'border': '3 px'},overwrite=False).set_table_styles([{
|
|
|
|
| 502 |
.set_table_styles([{'selector': 'thead th:nth-child(8)', 'props': [('min-width', '40px')]}], overwrite=False)
|
| 503 |
.background_gradient(cmap=cmap_sum,subset = (brushed_df_final.columns[-1]),vmin=80,vmax=120)
|
| 504 |
.applymap(lambda x: f'background-color: {dict_pitch_name.get(x, "")}', subset=['Pitch Type'])
|
| 505 |
+
.applymap(lambda x: f'background-color: black' if x == 0 else '', subset=['Spin'])
|
| 506 |
|
| 507 |
|
| 508 |
)
|