Spaces:
Runtime error
Runtime error
def recommendation_table_styler(styler): | |
proba_cols = [ | |
"proba_strong_up", | |
"proba_weak_up", | |
"proba_same", | |
"proba_weak_down", | |
"proba_strong_down", | |
] | |
styler = styler.background_gradient(subset=proba_cols, cmap="viridis_r", axis=1) | |
styler = styler.format({col: "{:.2%}" for col in proba_cols}) | |
styler = styler.background_gradient(subset=["actual"], cmap="viridis") | |
return styler | |
def portfolio_table_styler(styler): | |
proba_cols = [ | |
"strong up", | |
"weak up", | |
"same", | |
"weak down", | |
"strong down", | |
] | |
styler = styler.background_gradient(subset=proba_cols, cmap="viridis", axis=1) | |
styler = styler.format({col: "{:.2%}" for col in proba_cols}) | |
return styler | |