Update app.py
Browse files
app.py
CHANGED
@@ -171,9 +171,10 @@ with tab1:
|
|
171 |
projections['ownership'] = projections['ownership'].astype(float)
|
172 |
if type_var == 'Showdown':
|
173 |
if projections['captain ownership'].isna().all():
|
174 |
-
projections['
|
175 |
-
|
176 |
-
projections['captain ownership'] = projections['
|
|
|
177 |
|
178 |
projections = projections.apply(lambda x: x.replace(player_wrong_names_mlb, player_right_names_mlb))
|
179 |
st.dataframe(projections.head(10))
|
|
|
171 |
projections['ownership'] = projections['ownership'].astype(float)
|
172 |
if type_var == 'Showdown':
|
173 |
if projections['captain ownership'].isna().all():
|
174 |
+
projections['CPT_Own_raw'] = (projections['ownership'] / 2) * ((100 - (100-projections['ownership']))/100)
|
175 |
+
cpt_own_var = 100 / projections['CPT_Own_raw'].sum()
|
176 |
+
projections['captain ownership'] = projections['CPT_Own_raw'] * cpt_own_var
|
177 |
+
projections = projections.drop(columns='CPT_Own_raw', axis=1)
|
178 |
|
179 |
projections = projections.apply(lambda x: x.replace(player_wrong_names_mlb, player_right_names_mlb))
|
180 |
st.dataframe(projections.head(10))
|