James McCool
commited on
Commit
·
6d1503d
1
Parent(s):
3eae767
Refactor working dataframe handling in app.py for improved data organization
Browse files- Added a reset of the index for the working dataframe after sorting by 'actual_fpts', ensuring a clean and organized structure for subsequent operations.
- This change enhances data clarity and prepares the dataframe for better visualization and analysis.
app.py
CHANGED
|
@@ -313,8 +313,9 @@ with tab2:
|
|
| 313 |
working_df['under_10'] = working_df.groupby('BaseName')['dupes'].transform(
|
| 314 |
lambda x: (x <= 10).sum()
|
| 315 |
)
|
| 316 |
-
|
| 317 |
working_df = working_df.sort_values(by='actual_fpts', ascending=False)
|
|
|
|
| 318 |
working_df = working_df.reset_index()
|
| 319 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 320 |
working_df['finish'] = working_df['index']
|
|
@@ -389,6 +390,7 @@ with tab2:
|
|
| 389 |
)
|
| 390 |
|
| 391 |
working_df = working_df.sort_values(by='actual_fpts', ascending=False)
|
|
|
|
| 392 |
working_df = working_df.reset_index()
|
| 393 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 394 |
working_df['finish'] = working_df['index']
|
|
|
|
| 313 |
working_df['under_10'] = working_df.groupby('BaseName')['dupes'].transform(
|
| 314 |
lambda x: (x <= 10).sum()
|
| 315 |
)
|
| 316 |
+
|
| 317 |
working_df = working_df.sort_values(by='actual_fpts', ascending=False)
|
| 318 |
+
working_df = working_df.reset_index(drop=True)
|
| 319 |
working_df = working_df.reset_index()
|
| 320 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 321 |
working_df['finish'] = working_df['index']
|
|
|
|
| 390 |
)
|
| 391 |
|
| 392 |
working_df = working_df.sort_values(by='actual_fpts', ascending=False)
|
| 393 |
+
working_df = working_df.reset_index(drop=True)
|
| 394 |
working_df = working_df.reset_index()
|
| 395 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 396 |
working_df['finish'] = working_df['index']
|