James McCool
commited on
Commit
·
eb256a2
1
Parent(s):
2ad75df
Enhance data visibility in load_contest_file.py by replacing print statements with st.table
Browse files- Updated the load_contest_file function to display the first 10 rows of cleaned_df using st.table instead of print statements, improving the user interface for data review.
- Maintained existing functionality while enhancing the clarity and presentation of contest data during processing.
global_func/load_contest_file.py
CHANGED
@@ -113,6 +113,7 @@ def load_contest_file(upload, helper_var, helper = None, sport = None):
|
|
113 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' P ', ' C ', '1B ', ' 2B ', ' 3B ', ' SS ', ' OF ', ' G ', 'G '], value=',', regex=True)
|
114 |
print(sport)
|
115 |
print(cleaned_df.head(10))
|
|
|
116 |
check_lineups = cleaned_df.copy()
|
117 |
if sport == 'MLB':
|
118 |
cleaned_df[['Remove', '1B', '2B', '3B', 'C', 'OF1', 'OF2', 'OF3', 'P1', 'P2', 'SS']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
@@ -120,7 +121,7 @@ def load_contest_file(upload, helper_var, helper = None, sport = None):
|
|
120 |
cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
121 |
elif sport == 'GOLF':
|
122 |
cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
123 |
-
|
124 |
cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
|
125 |
entry_counts = cleaned_df['BaseName'].value_counts()
|
126 |
cleaned_df['EntryCount'] = cleaned_df['BaseName'].map(entry_counts)
|
@@ -130,7 +131,7 @@ def load_contest_file(upload, helper_var, helper = None, sport = None):
|
|
130 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
|
131 |
elif sport == 'GOLF':
|
132 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
|
133 |
-
|
134 |
|
135 |
print('Made it through check_lineups')
|
136 |
|
|
|
113 |
cleaned_df['Lineup'] = cleaned_df['Lineup'].replace([' P ', ' C ', '1B ', ' 2B ', ' 3B ', ' SS ', ' OF ', ' G ', 'G '], value=',', regex=True)
|
114 |
print(sport)
|
115 |
print(cleaned_df.head(10))
|
116 |
+
st.table(cleaned_df.head(10))
|
117 |
check_lineups = cleaned_df.copy()
|
118 |
if sport == 'MLB':
|
119 |
cleaned_df[['Remove', '1B', '2B', '3B', 'C', 'OF1', 'OF2', 'OF3', 'P1', 'P2', 'SS']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
|
|
121 |
cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
122 |
elif sport == 'GOLF':
|
123 |
cleaned_df[['Remove', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']] = cleaned_df['Lineup'].str.split(',', expand=True)
|
124 |
+
st.table(cleaned_df.head(10))
|
125 |
cleaned_df = cleaned_df.drop(columns=['Lineup', 'Remove'])
|
126 |
entry_counts = cleaned_df['BaseName'].value_counts()
|
127 |
cleaned_df['EntryCount'] = cleaned_df['BaseName'].map(entry_counts)
|
|
|
131 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
|
132 |
elif sport == 'GOLF':
|
133 |
cleaned_df = cleaned_df[['BaseName', 'EntryCount', 'Guy', 'Dude', 'Pooba', 'Bub', 'Chief', 'Buddy']]
|
134 |
+
st.table(cleaned_df.head(10))
|
135 |
|
136 |
print('Made it through check_lineups')
|
137 |
|