Spaces:
Running
Running
James McCool
commited on
Commit
·
f32fab3
1
Parent(s):
be18b60
dropped dupes on QB and non-qb stats based on player/position
Browse files
app.py
CHANGED
@@ -138,7 +138,9 @@ with tab2:
|
|
138 |
st.cache_data.clear()
|
139 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
140 |
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
|
|
141 |
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
|
|
142 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
143 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
144 |
split_var1 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var1')
|
@@ -147,7 +149,6 @@ with tab2:
|
|
147 |
elif split_var1 == 'All':
|
148 |
team_var1 = qb_stats.Team.values.tolist()
|
149 |
qb_stats = qb_stats[qb_stats['Team'].isin(team_var1)]
|
150 |
-
qb_stats = qb_stats.drop_duplicates(subset='Player')
|
151 |
qb_stats_disp = qb_stats.set_index('Player')
|
152 |
qb_stats_disp = qb_stats_disp.sort_values(by='PPR', ascending=False)
|
153 |
st.dataframe(qb_stats_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height = 1000, use_container_width = True)
|
|
|
138 |
st.cache_data.clear()
|
139 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
140 |
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
141 |
+
qb_stats = qb_stats.drop_duplicates(subset=['Player', 'Position'])
|
142 |
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
143 |
+
non_qb_stats = non_qb_stats.drop_duplicates(subset=['Player', 'Position'])
|
144 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
145 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
146 |
split_var1 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var1')
|
|
|
149 |
elif split_var1 == 'All':
|
150 |
team_var1 = qb_stats.Team.values.tolist()
|
151 |
qb_stats = qb_stats[qb_stats['Team'].isin(team_var1)]
|
|
|
152 |
qb_stats_disp = qb_stats.set_index('Player')
|
153 |
qb_stats_disp = qb_stats_disp.sort_values(by='PPR', ascending=False)
|
154 |
st.dataframe(qb_stats_disp.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height = 1000, use_container_width = True)
|