James McCool
commited on
Commit
·
4f6b05a
1
Parent(s):
5f9c332
Fix column renaming logic in app.py for player and stack counts
Browse files- Updated the renaming of columns in player and stack dataframes to use 'count' instead of 0, ensuring accurate representation in the display.
- Enhanced clarity in the data presentation by maintaining consistent naming conventions across the application.
app.py
CHANGED
@@ -194,14 +194,14 @@ with tab2:
|
|
194 |
with tab1:
|
195 |
player_counts = pd.Series(list(contest_players[player_columns].values.flatten())).value_counts()
|
196 |
st.write(player_counts)
|
197 |
-
player_frame = player_counts.to_frame().reset_index().rename(columns={'index': 'Player',
|
198 |
player_frame['Percent'] = player_frame['Count'] / len(working_df)
|
199 |
player_frame = player_frame[['Player', 'Count', 'Percent']]
|
200 |
st.dataframe(player_frame)
|
201 |
with tab2:
|
202 |
stack_counts = pd.Series(list(working_df['stack'].unique())).value_counts()
|
203 |
st.write(stack_counts)
|
204 |
-
stack_frame = stack_counts.to_frame().reset_index().rename(columns={'index': 'Stack',
|
205 |
stack_frame['Percent'] = stack_frame['Count'] / len(working_df)
|
206 |
stack_frame = stack_frame[['Stack', 'Count', 'Percent']]
|
207 |
st.dataframe(stack_frame)
|
|
|
194 |
with tab1:
|
195 |
player_counts = pd.Series(list(contest_players[player_columns].values.flatten())).value_counts()
|
196 |
st.write(player_counts)
|
197 |
+
player_frame = player_counts.to_frame().reset_index().rename(columns={'index': 'Player', 'count': 'Count'})
|
198 |
player_frame['Percent'] = player_frame['Count'] / len(working_df)
|
199 |
player_frame = player_frame[['Player', 'Count', 'Percent']]
|
200 |
st.dataframe(player_frame)
|
201 |
with tab2:
|
202 |
stack_counts = pd.Series(list(working_df['stack'].unique())).value_counts()
|
203 |
st.write(stack_counts)
|
204 |
+
stack_frame = stack_counts.to_frame().reset_index().rename(columns={'index': 'Stack', 'count': 'Count'})
|
205 |
stack_frame['Percent'] = stack_frame['Count'] / len(working_df)
|
206 |
stack_frame = stack_frame[['Stack', 'Count', 'Percent']]
|
207 |
st.dataframe(stack_frame)
|