Wrestling - uwaggs/usportspy GitHub Wiki

Wrestling Functions

The usportspy package offers functions to retrieve wrestling-related data, such as athlete rankings by weight category and team rankings.

Functions

wrestling_athlete_rankings

Fetches wrestling athlete rankings for a specified gender and weight category.

Parameters:

  • gender (str): Specifies the gender of the athletes. Must be either "m" or "w".
  • weight (int): The weight category in kilograms.

Returns:

  • pd.DataFrame: A DataFrame containing the rankings of athletes in the specified weight category. The columns of the returned DataFrame are: weight_category, rank, name, school, and last_updated.

Example:

from usportspy import wrestling_athlete_rankings

# Get male athlete rankings in the 57kg weight category
male_athlete_rankings = wrestling_athlete_rankings("m", 57)
print(male_athlete_rankings.head())

# Get female athlete rankings in the 56kg weight category
female_athlete_rankings = wrestling_athlete_rankings("w", 56)
print(female_athlete_rankings.head())

Expected output:

  weight_category rank               name        school last_updated
0            57kg    1      Kyle Robinson        Guelph   02/01/2020
1            57kg    2   Garette Saunders         Brock   02/01/2020
2            57kg    3      Harris Valdes       Alberta   02/01/2020
3            57kg    4     Drake Buechler  Saskatchewan   02/01/2020
4            57kg    5  Francesco Fortino      McMaster   02/01/2020


  weight_category  rank             name        school last_updated
0            56kg     1  Alexandria Town          York   11/16/2021
1            56kg     2    SueAnne Harms  Saskatchewan   11/16/2021
2            56kg     3      Vivica Addo       Alberta   11/16/2021
3            56kg     4   Grace Chambers       Calgary   11/16/2021
4            56kg     5    Macy Malysiak      McMaster   11/16/2021

wrestling_team_rankings

Fetches wrestling team rankings for a specified gender.

Parameters:

  • gender (str): Specifies the gender of the teams. Must be either "m" or "w".

Returns:

  • pd.DataFrame: A DataFrame containing the team rankings. The columns of the returned DataFrame are: rank, school, points, previous_rank, and last_updated.

Example:

from usportspy import wrestling_team_rankings

# Get male team rankings
male_team_rankings = wrestling_team_rankings("m")
print(male_team_rankings.head())

# Get female team rankings
female_team_rankings = wrestling_team_rankings("w")
print(female_team_rankings.head())

Expected output:

   rank        school  points previous_rank last_updated
0     1         Brock      81             1   02/01/2020
1     2  Saskatchewan      50             3   02/01/2020
2     3       Alberta      49             2   02/01/2020
3     4     Concordia      47             7   02/01/2020
4     5        Guelph      42             6   02/01/2020


   rank        school  points previous_rank last_updated
0     1         Brock      50             1   02/01/2020
1     2       Calgary      45             3   02/01/2020
2     3  Saskatchewan      41             2   02/01/2020
3     4     Concordia      32             5   02/01/2020
4     5       Alberta      31             4   02/01/2020