20+ Sports Related Data Sets In A Single Line of Code

coding + programming data Mar 02, 2023

Here are 20+ easily loadable sports-related datasets for you to begin exploring right away.

With every season that goes by, sports are increasingly more data driven.

Coaches routinely look at player stats before making a pick. Gamblers look for unusual correlations to find edges in their betting strategies. Casual fans use data to get a better grasp of the game.

So with that in mind, in this article I present you with a handful of sports datasets for you to explore.

What's more, since the goal of this article is also to be useful and actionable for you, you will be able to load all of the datasets below with only a single line of code. (Some limitations of this approach are discussed at the end of the article, please check that out)

Now without further ado, let's begin.

1-5 Football (American)

American football is easily the most popular sport in the US, having one of the most fervent and fanatical fanbases in the country.

So with that in mind, let's start our list of sports-related datasets with this spectacular sport for you to dive deep into the numbers that drive this game and see where your curiosity takes you.

Have in mind that some of the datasets below will only be loaded properly if you add the skiprows parameter inside the pd.read_csv method.

NFL fanbase compared against other major sports leagues. Also includes that area's 2016 voting rates for Trump.

pd.read_csv('https://raw.githubusercontent.com/' + \
'fivethirtyeight/data/master/' + \
'nfl-fandom/NFL_fandom_data-google_trends.csv',
skiprows=1)

For the result (excerpted):

NFL fanbases by race.

pd.read_csv('https://raw.githubusercontent.com/' + \
'fivethirtyeight/data/master/' + \
'nfl-fandom/NFL_fandom_data-surveymonkey.csv',
skiprows=1)

For the result (excerpted):

NFL match predictions since the 1920 season.

pd.read_csv('https://projects.fivethirtyeight.com/' + \
'nfl-api/nfl_elo.csv')

For the result (excerpted):

NFL penalties and suspensions.

pd.read_csv('https://raw.githubusercontent.com/' + \
'ali-ce/datasets/master/' + \
'NFL-Fines-and-Suspensions/' + \
'All%20Penalties.csv')

For the result (excerpted):

Head injuries in the NFL.

pd.read_csv('https://raw.githubusercontent.com/' + \
'ali-ce/datasets/master/NFL/' + \
'Head%20Injured%20Players.csv')

For the result (excerpted):

6-7 Basketball

After football, Basketball is the most popular sport in America. Being responsible for billions of dollars in yearly ad revenue for TV networks and billions more in merchandising sales for sporting goods stores.

Not surprisingly, basketball enthusiasts now keep track of every single nuance that can happen in a game and use this data to try and predict game winners' and players' performances.

Below, I will present you with a couple of remarkable datasets for you to explore and deepen your understanding of this incredible sport.

NBA season 19-20 play - by - play.

pd.read_csv('https://sports-statistics.com/' + \
'database/basketball-data/nba/' + \
'2019-20_pbp.csv')

For the result (excerpted):

NCAA Basketball team statistics.

pd.read_csv('https://raw.githubusercontent.com/' + \
'fivethirtyeight/data/master/' + \
'ncaa-womens-basketball-tournament/' + \
'ncaa-womens-basketball-tournament-history.csv')

For the result (excerpted):

 

 

 

 

 

 

 

 

Now Offering Live Free Online Data Science Lessons.

 

Get You're Free Lesson Here