James McCool
commited on
Commit
·
da7253c
1
Parent(s):
691ab8e
Update player and stack counts calculation in app.py for improved accuracy
Browse files- Modified player counts to use a Series from the list of contest players, ensuring accurate representation of player usage.
- Updated stack counts to reflect unique stack values, enhancing the clarity of stack data presentation.
- Adjusted the calculation of percentages for both players and stacks to maintain consistency in data analysis.
app.py
CHANGED
@@ -192,13 +192,13 @@ with tab2:
|
|
192 |
with st.container():
|
193 |
tab1, tab2 = st.tabs(['Player Used Info', 'Stack Used Info'])
|
194 |
with tab1:
|
195 |
-
player_counts = contest_players.value_counts()
|
196 |
player_frame = player_counts.to_frame().reset_index().rename(columns={'index': 'Player', 0: 'Count'})
|
197 |
player_frame['Percent'] = player_frame['Count'] / len(working_df)
|
198 |
player_frame = player_frame[['Player', 'Count', 'Percent']]
|
199 |
st.dataframe(player_frame)
|
200 |
with tab2:
|
201 |
-
stack_counts = working_df['stack'].value_counts()
|
202 |
stack_frame = stack_counts.to_frame().reset_index().rename(columns={'index': 'Stack', 0: 'Count'})
|
203 |
stack_frame['Percent'] = stack_frame['Count'] / len(working_df)
|
204 |
stack_frame = stack_frame[['Stack', 'Count', 'Percent']]
|
|
|
192 |
with st.container():
|
193 |
tab1, tab2 = st.tabs(['Player Used Info', 'Stack Used Info'])
|
194 |
with tab1:
|
195 |
+
player_counts = pd.Series(list(contest_players)).value_counts()
|
196 |
player_frame = player_counts.to_frame().reset_index().rename(columns={'index': 'Player', 0: 'Count'})
|
197 |
player_frame['Percent'] = player_frame['Count'] / len(working_df)
|
198 |
player_frame = player_frame[['Player', 'Count', 'Percent']]
|
199 |
st.dataframe(player_frame)
|
200 |
with tab2:
|
201 |
+
stack_counts = pd.Series(list(working_df['stack'].unique())).value_counts()
|
202 |
stack_frame = stack_counts.to_frame().reset_index().rename(columns={'index': 'Stack', 0: 'Count'})
|
203 |
stack_frame['Percent'] = stack_frame['Count'] / len(working_df)
|
204 |
stack_frame = stack_frame[['Stack', 'Count', 'Percent']]
|