James McCool
commited on
Commit
·
16d2d15
1
Parent(s):
29e4551
Fix logic in `find_name_mismatches.py` to correctly identify players missing from projections
Browse files- Updated the calculation of `players_missing_from_projections` to accurately reflect the difference between projection players and portfolio players.
- Adjusted the matching process to ensure that the closest matches are derived from the correct player list, enhancing the accuracy of name matching.
global_func/find_name_mismatches.py
CHANGED
@@ -23,7 +23,7 @@ def find_name_mismatches(contest_df, projections_df):
|
|
23 |
projection_players_list = list(projection_players)
|
24 |
|
25 |
# Find players in portfolio that are missing from projections
|
26 |
-
players_missing_from_projections = list(
|
27 |
|
28 |
# Automatically handle 100% matches before starting interactive process
|
29 |
players_to_process = []
|
@@ -31,7 +31,7 @@ def find_name_mismatches(contest_df, projections_df):
|
|
31 |
if not isinstance(player, str):
|
32 |
st.warning(f"Skipping non-string value: {player}")
|
33 |
continue
|
34 |
-
closest_matches = process.extract(player,
|
35 |
if closest_matches[0][1] == 100: # If perfect match found
|
36 |
match_name = closest_matches[0][0]
|
37 |
# Update all occurrences in contest_df
|
|
|
23 |
projection_players_list = list(projection_players)
|
24 |
|
25 |
# Find players in portfolio that are missing from projections
|
26 |
+
players_missing_from_projections = list(projection_players -portfolio_players)
|
27 |
|
28 |
# Automatically handle 100% matches before starting interactive process
|
29 |
players_to_process = []
|
|
|
31 |
if not isinstance(player, str):
|
32 |
st.warning(f"Skipping non-string value: {player}")
|
33 |
continue
|
34 |
+
closest_matches = process.extract(player, portfolio_players, limit=1)
|
35 |
if closest_matches[0][1] == 100: # If perfect match found
|
36 |
match_name = closest_matches[0][0]
|
37 |
# Update all occurrences in contest_df
|