Skip to content

Instantly share code, notes, and snippets.

@jbarton311
Created April 6, 2019 19:26
Show Gist options
  • Select an option

  • Save jbarton311/47dd7fbf37c3714dd0c22b8c711fe9ee to your computer and use it in GitHub Desktop.

Select an option

Save jbarton311/47dd7fbf37c3714dd0c22b8c711fe9ee to your computer and use it in GitHub Desktop.

Revisions

  1. jbarton311 created this gist Apr 6, 2019.
    13 changes: 13 additions & 0 deletions world_golf_rankings.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import pandas as pd

    # Started by Googling "World Golf Rankings"
    # Clicked on 1st site I found
    # Needed to expand the ranking table to "all"
    data = pd.read_html('http://www.owgr.com/ranking?pageNo=1&pageSize=All&country=All')

    # pd.read_html will return a list of data frames
    # usually you need to go through this list to find the data
    # you are looking for
    rankings_df = data[0]

    # This dataframe will need a little clean up but the data is there