Skip to content

Commit

Permalink
Fix link
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGFagan committed Oct 22, 2024
1 parent 3cab711 commit cc52229
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pybaseball/amateur_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def clean_draft_results_with_links(draft_results: pd.DataFrame) -> pd.DataFrame:
draft_results['link'] = draft_results['Name'].apply(
lambda value: value[1] if value[1] != None else 'NA'
)
draft_results['id_type'] = draft_results['Link'].apply(
draft_results['id_type'] = draft_results['link'].apply(
lambda value:
'baseball_reference_minor_league_id' if 'register' in value
else 'baseball_reference_id' if 'players' in value
else 'NA'
)
draft_results['player_id'] = draft_results['Link'].apply(
draft_results['player_id'] = draft_results['link'].apply(
lambda value:
value.split('=')[-1] if 'register' in value
else value.split('/')[-1].split('.')[0] if 'players' in value
Expand Down

0 comments on commit cc52229

Please sign in to comment.