Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -51,8 +51,8 @@ gcservice_account, gcservice_account2, db, NFL_Data = init_conn()
|
|
51 |
|
52 |
percentages_format = {'Exposure': '{:.2%}'}
|
53 |
freq_format = {'Exposure': '{:.2%}', 'Proj Own': '{:.2%}', 'Edge': '{:.2%}'}
|
54 |
-
dk_columns = ['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']
|
55 |
-
fd_columns = ['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']
|
56 |
|
57 |
@st.cache_data(ttl = 599)
|
58 |
def init_DK_seed_frames():
|
@@ -61,7 +61,7 @@ def init_DK_seed_frames():
|
|
61 |
cursor = collection.find()
|
62 |
|
63 |
raw_display = pd.DataFrame(list(cursor))
|
64 |
-
raw_display = raw_display[['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']]
|
65 |
DK_seed = raw_display.to_numpy()
|
66 |
|
67 |
return DK_seed
|
@@ -73,7 +73,7 @@ def init_FD_seed_frames():
|
|
73 |
cursor = collection.find()
|
74 |
|
75 |
raw_display = pd.DataFrame(list(cursor))
|
76 |
-
raw_display = raw_display[['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count']]
|
77 |
FD_seed = raw_display.to_numpy()
|
78 |
|
79 |
return FD_seed
|
@@ -140,8 +140,8 @@ def sim_contest(Sim_size, seed_frame, maps_dict, sharp_split, Contest_Size):
|
|
140 |
sample_arrays1 = np.c_[
|
141 |
fp_random,
|
142 |
np.sum(np.random.normal(
|
143 |
-
loc=vec_projection_map(fp_random[:, :-
|
144 |
-
scale=vec_stdev_map(fp_random[:, :-
|
145 |
axis=1)
|
146 |
]
|
147 |
|
@@ -306,7 +306,7 @@ with tab1:
|
|
306 |
Sim_Winner_Frame = Sim_Winner_Frame.assign(win_count=Sim_Winner_Frame['unique_id'].map(Sim_Winner_Frame['unique_id'].value_counts()))
|
307 |
|
308 |
# Type Casting
|
309 |
-
type_cast_dict = {'salary': int, 'proj': np.float16, 'Fantasy': np.float16, 'GPP_Proj': np.float32}
|
310 |
Sim_Winner_Frame = Sim_Winner_Frame.astype(type_cast_dict)
|
311 |
|
312 |
# Sorting
|
@@ -344,7 +344,7 @@ with tab1:
|
|
344 |
Sim_Winner_Frame = Sim_Winner_Frame.assign(win_count=Sim_Winner_Frame['unique_id'].map(Sim_Winner_Frame['unique_id'].value_counts()))
|
345 |
|
346 |
# Type Casting
|
347 |
-
type_cast_dict = {'salary': int, 'proj': np.float16, 'Fantasy': np.float16, 'GPP_Proj': np.float32}
|
348 |
Sim_Winner_Frame = Sim_Winner_Frame.astype(type_cast_dict)
|
349 |
|
350 |
# Sorting
|
|
|
51 |
|
52 |
percentages_format = {'Exposure': '{:.2%}'}
|
53 |
freq_format = {'Exposure': '{:.2%}', 'Proj Own': '{:.2%}', 'Edge': '{:.2%}'}
|
54 |
+
dk_columns = ['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
55 |
+
fd_columns = ['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']
|
56 |
|
57 |
@st.cache_data(ttl = 599)
|
58 |
def init_DK_seed_frames():
|
|
|
61 |
cursor = collection.find()
|
62 |
|
63 |
raw_display = pd.DataFrame(list(cursor))
|
64 |
+
raw_display = raw_display[['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
65 |
DK_seed = raw_display.to_numpy()
|
66 |
|
67 |
return DK_seed
|
|
|
73 |
cursor = collection.find()
|
74 |
|
75 |
raw_display = pd.DataFrame(list(cursor))
|
76 |
+
raw_display = raw_display[['QB', 'RB1', 'RB2', 'WR1', 'WR2', 'WR3', 'TE', 'FLEX', 'DST', 'salary', 'proj', 'Team', 'Team_count', 'Secondary', 'Secondary_count', 'Own']]
|
77 |
FD_seed = raw_display.to_numpy()
|
78 |
|
79 |
return FD_seed
|
|
|
140 |
sample_arrays1 = np.c_[
|
141 |
fp_random,
|
142 |
np.sum(np.random.normal(
|
143 |
+
loc=vec_projection_map(fp_random[:, :-7]),
|
144 |
+
scale=vec_stdev_map(fp_random[:, :-7])),
|
145 |
axis=1)
|
146 |
]
|
147 |
|
|
|
306 |
Sim_Winner_Frame = Sim_Winner_Frame.assign(win_count=Sim_Winner_Frame['unique_id'].map(Sim_Winner_Frame['unique_id'].value_counts()))
|
307 |
|
308 |
# Type Casting
|
309 |
+
type_cast_dict = {'salary': int, 'proj': np.float16, 'Fantasy': np.float16, 'GPP_Proj': np.float32, 'Own': np.float32}
|
310 |
Sim_Winner_Frame = Sim_Winner_Frame.astype(type_cast_dict)
|
311 |
|
312 |
# Sorting
|
|
|
344 |
Sim_Winner_Frame = Sim_Winner_Frame.assign(win_count=Sim_Winner_Frame['unique_id'].map(Sim_Winner_Frame['unique_id'].value_counts()))
|
345 |
|
346 |
# Type Casting
|
347 |
+
type_cast_dict = {'salary': int, 'proj': np.float16, 'Fantasy': np.float16, 'GPP_Proj': np.float32, 'Own': np.float32}
|
348 |
Sim_Winner_Frame = Sim_Winner_Frame.astype(type_cast_dict)
|
349 |
|
350 |
# Sorting
|