Spaces:
Running
Running
Jon Solow
commited on
Commit
·
6492af1
1
Parent(s):
a3ce631
Add default value -99 and fix for Teddy B
Browse files- src/pages/1_Keepers.py +7 -1
src/pages/1_Keepers.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import streamlit as st
|
| 4 |
|
|
@@ -36,11 +37,16 @@ def convert_ecr_to_round_val(ecr_float: float, round_offset: float = 1.0, pick_o
|
|
| 36 |
|
| 37 |
|
| 38 |
def add_opinionated_keeper_value(df: pd.DataFrame):
|
|
|
|
|
|
|
|
|
|
| 39 |
df["ecr"] = df["ecr"].apply(convert_ecr_to_round_val)
|
| 40 |
# Convert sd without offset to show as pure pick diff
|
| 41 |
df["sd"] = df["sd"].apply(lambda x: convert_ecr_to_round_val(x, 0, 0))
|
| 42 |
# assumes midround keeper
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
@st.cache_data(ttl=60 * 60 * 24)
|
|
|
|
| 1 |
import os
|
| 2 |
+
import numpy as np
|
| 3 |
import pandas as pd
|
| 4 |
import streamlit as st
|
| 5 |
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
def add_opinionated_keeper_value(df: pd.DataFrame):
|
| 40 |
+
# Manual Hack for error
|
| 41 |
+
df.loc[df["name"] == "Teddy Bridgewater", ["ecr"]] = np.nan
|
| 42 |
+
|
| 43 |
df["ecr"] = df["ecr"].apply(convert_ecr_to_round_val)
|
| 44 |
# Convert sd without offset to show as pure pick diff
|
| 45 |
df["sd"] = df["sd"].apply(lambda x: convert_ecr_to_round_val(x, 0, 0))
|
| 46 |
# assumes midround keeper
|
| 47 |
+
# fill -99 for players that are not ranked in ecr
|
| 48 |
+
df["value_keeper"] = (df["keeper_cost"] + 0.5 - df["ecr"]).fillna(-99)
|
| 49 |
+
|
| 50 |
|
| 51 |
|
| 52 |
@st.cache_data(ttl=60 * 60 * 24)
|