File size: 768 Bytes
3d741dc
df9b0ed
62447eb
 
 
 
 
df9b0ed
329d438
df9b0ed
e451088
7eb2507
df9b0ed
 
 
 
 
 
 
 
 
 
9567b04
 
df9b0ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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", 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