Swimming - uwaggs/usportspy GitHub Wiki

Swimming Functions

The usportspy package includes functions to retrieve rankings for swimming teams and athletes.

Functions

swimming_team_rankings

Fetches the rankings of swimming teams.

Parameters:

  • None

Returns:

  • pd.DataFrame: A DataFrame containing the swimming team rankings. The columns of the returned DataFrame are: rank, team, count, gender, and date.

Example:

from usportspy import swimming_team_rankings

# Get the swimming team rankings
team_rankings = swimming_team_rankings()
print(team_rankings.head())

Expected output:

   rank                            team  count gender        date
0     1           University Of Toronto    585   Male  31/05/2024
1     2  University Of British Columbia    485   Male  31/05/2024
2     3   University Of Calgary Varsity    409   Male  31/05/2024
3     4               McGill University    309   Male  31/05/2024
4     5            University Of Ottawa    210   Male  31/05/2024

swimming_athlete_rankings

Fetches the rankings of swimming athletes.

Parameters:

  • None

Returns:

  • pd.DataFrame: A DataFrame containing the swimming athlete rankings. The columns of the returned DataFrame are: season, gender, rank, athlete_university, age, team, conference, date, meet, time, fina, event, and date_collected.

Example:

from usportspy import swimming_athlete_rankings

# Get the swimming athlete rankings
athlete_rankings = swimming_athlete_rankings()
print(athlete_rankings.head())

Expected output:

      season gender  rank athlete_university   age    team   conference        date                                               meet   time  fina    event date_collected
0  2007-2008   Male     1      Forde, Martyn  22.0      UT      Ontario  2007-11-24                                    BELL Grand Prix  22.78   815  50 Free     27/06/2024
1  2007-2008   Male     2   Haynes, Terrence  23.0      UT      Ontario  2008-02-08                   Ontario University Championships  22.84   809  50 Free     27/06/2024
2  2007-2008   Male     3         Ng, Callum  22.0    UBCT  Canada West  2008-01-25                 Canada West Swimming Championships  23.09   783  50 Free     27/06/2024
3  2007-2008   Male     4     Anctil, Pascal  25.0    UQTR       Quebec  2008-02-10  Championnat provincial universitaire de natati...  23.27   765  50 Free     27/06/2024
4  2007-2008   Male     5  Savoie, Alexandre  22.0  ULAVAL       Quebec  2007-12-07           Inv. prov. P1-P2 Défi Rouge et Or + NAUH  23.32   760  50 Free     27/06/2024