James McCool
commited on
Commit
·
6db62f0
1
Parent(s):
56e1d7b
Refactor percentile finish calculation in app.py
Browse files- Removed the offset of 0.01 from the 'percentile_finish' calculation to ensure accurate percentile rankings without artificial differentiation for identical ranks.
- This change enhances the integrity of the percentile data, improving the overall analysis of player performance metrics.
app.py
CHANGED
@@ -148,7 +148,7 @@ with tab2:
|
|
148 |
)
|
149 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
150 |
working_df = working_df.reset_index()
|
151 |
-
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
152 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
153 |
elif type_var == 'Showdown':
|
154 |
working_df['stack'] = working_df.apply(
|
@@ -186,7 +186,7 @@ with tab2:
|
|
186 |
)
|
187 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
188 |
working_df = working_df.reset_index()
|
189 |
-
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
190 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
191 |
|
192 |
# Initialize pagination in session state if not exists
|
|
|
148 |
)
|
149 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
150 |
working_df = working_df.reset_index()
|
151 |
+
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
152 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
153 |
elif type_var == 'Showdown':
|
154 |
working_df['stack'] = working_df.apply(
|
|
|
186 |
)
|
187 |
working_df['dupes'] = working_df.groupby('sorted').transform('size')
|
188 |
working_df = working_df.reset_index()
|
189 |
+
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
190 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
191 |
|
192 |
# Initialize pagination in session state if not exists
|