James McCool
commited on
Commit
·
772166a
1
Parent(s):
77d71e0
Update duplicate calculation logic in app.py
Browse files- Modified the grouping for duplicate entries from 'sorted' to 'actual_fpts' to enhance accuracy in counting duplicates based on actual fantasy points.
- Ensured consistent application of this change across relevant sections of the code.
app.py
CHANGED
|
@@ -429,7 +429,7 @@ if selected_tab == 'Data Load':
|
|
| 429 |
working_df['sorted'] = working_df[st.session_state['player_columns']].apply(
|
| 430 |
lambda row: ','.join(sorted(row.values)), axis=1
|
| 431 |
)
|
| 432 |
-
working_df['dupes'] = working_df.groupby('
|
| 433 |
|
| 434 |
# Vectorized unique calculations
|
| 435 |
working_df['uniques'] = working_df.groupby('BaseName')['dupes'].transform(
|
|
@@ -527,7 +527,7 @@ if selected_tab == 'Data Load':
|
|
| 527 |
working_df['sorted'] = working_df[st.session_state['player_columns']].apply(
|
| 528 |
lambda row: ','.join(sorted(row.values)), axis=1
|
| 529 |
)
|
| 530 |
-
working_df['dupes'] = working_df.groupby('
|
| 531 |
|
| 532 |
# Vectorized unique calculations
|
| 533 |
working_df['uniques'] = working_df.groupby('BaseName')['dupes'].transform(
|
|
|
|
| 429 |
working_df['sorted'] = working_df[st.session_state['player_columns']].apply(
|
| 430 |
lambda row: ','.join(sorted(row.values)), axis=1
|
| 431 |
)
|
| 432 |
+
working_df['dupes'] = working_df.groupby('actual_fpts').transform('size')
|
| 433 |
|
| 434 |
# Vectorized unique calculations
|
| 435 |
working_df['uniques'] = working_df.groupby('BaseName')['dupes'].transform(
|
|
|
|
| 527 |
working_df['sorted'] = working_df[st.session_state['player_columns']].apply(
|
| 528 |
lambda row: ','.join(sorted(row.values)), axis=1
|
| 529 |
)
|
| 530 |
+
working_df['dupes'] = working_df.groupby('actual_fpts').transform('size')
|
| 531 |
|
| 532 |
# Vectorized unique calculations
|
| 533 |
working_df['uniques'] = working_df.groupby('BaseName')['dupes'].transform(
|