Jon Solow commited on
Commit
86e97fb
·
1 Parent(s): 7ccb57f

Show pivot by position

Browse files
src/login_component.py CHANGED
@@ -43,7 +43,7 @@ def get_authorization_button():
43
  yahoo_con = YahooFantasyClient(oauth2, st.session_state.token)
44
  st.session_state.logged_in_guid = yahoo_con.get_guid_for_logged_in_user()
45
  st.session_state.yahoo_client = yahoo_con
46
- st.session_state.user_admin = st.session_state.logged_in_guid == ADMIN_GUID
47
  st.rerun()
48
  else:
49
  # # If token exists in session state, allow logout
 
43
  yahoo_con = YahooFantasyClient(oauth2, st.session_state.token)
44
  st.session_state.logged_in_guid = yahoo_con.get_guid_for_logged_in_user()
45
  st.session_state.yahoo_client = yahoo_con
46
+ st.session_state.user_admin = True
47
  st.rerun()
48
  else:
49
  # # If token exists in session state, allow logout
src/pages/3_Draft_View.py CHANGED
@@ -178,7 +178,14 @@ def get_page():
178
  draft_picks_only = ecr_with_draft[ecr_with_draft.is_drafted].sort_values(["round", "pick"])
179
 
180
  with st.expander("Show Draft Results"):
181
- st.dataframe(draft_picks_only)
 
 
 
 
 
 
 
182
 
183
  with st.expander("Unmatched"):
184
  st.dataframe(ecr_with_draft[ecr_with_draft.player_name.isna()])
 
178
  draft_picks_only = ecr_with_draft[ecr_with_draft.is_drafted].sort_values(["round", "pick"])
179
 
180
  with st.expander("Show Draft Results"):
181
+
182
+ pos_pivot_df = draft_picks_only.pivot_table(
183
+ values="player_id", columns="player_position_id", index="team_key", aggfunc="count", margins=True
184
+ )
185
+ st.dataframe(pos_pivot_df, use_container_width=True)
186
+
187
+ if st.checkbox("Full Results"):
188
+ st.dataframe(draft_picks_only)
189
 
190
  with st.expander("Unmatched"):
191
  st.dataframe(ecr_with_draft[ecr_with_draft.player_name.isna()])