After having retrieved data from the ATP website, this function cleans the player stats in a systematic way given that all the information has been found and is in the correct format.
Data from ATP site
Cleans the data to have the following columns:
name: First and Last Name
age: Age and Birth Date
df: Double Faults
first_serve: 1st Serve
first_serve_won: 1st Serve Points Won
second_serve_won: 2nd Serve Points Won
bp_faced: Break Points Faced
bp_saved: Break Points Saved
serv_game_played: Service Games Played
serv_game_won: Service Games Won
total_serv_won: Total Service Points Won
first_return: 1st Serve Return Points Won
second_return: 2nd Serve Return Points Won
bp_opp: Break Points Opportunities
bp_conv: Break Points Converted
ret_game_played: Return Games Played
ret_game_won: Return Games Won
ret_won: Return Points Won
total_ret_won: Total Points Won
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.