NFL Betting, are you REALLY in it to win it?¶

Describe the problem¶

Sports betting is huge in American culture, and so is the NFL! However, no one likes to lose money, so finding strategies, superstitions, and lucky bets are a few ways that people try to get the best bang for their buck when it comes to betting on NFL games. The NFL offers numerous different features that makes betting on their games unique, including point spread betting, football squares, and weather affecting different stadiums in different ways. Click here if you are interested in learning some more about NFL betting, or here if you are curious as to how many people really bet sports in America. While there may not be one foolproof solution to always make the best bet, my aim with this project is to draw insight on the history of predictions and outcomes of NFL games and offer insight and advice to those looking to make a little money betting on the league where they play, for pay!

teams and logos

The Data¶

Here is a link to the data set I will be using. It has three different files, one with information on different stadiums, one with information on different teams, and one with information on every NFL game played since 1966 with some relevant info included like whether or not it was a playoff game and what the weather was like. For my project I was going to narrow it down to everything post 2000 or some other more recent metric because I don't think we need to look through data before that.

In [1]:
import pandas as pd

df_stadiums = pd.read_csv('nfl_stadiums_new.csv')

df_stadiums.head()
Out[1]:
stadium_name stadium_location stadium_open stadium_close stadium_type stadium_address stadium_weather_station_code stadium_weather_type stadium_capacity stadium_surface STATION NAME LATITUDE LONGITUDE ELEVATION
0 Acrisure Stadium Pittsburgh, PA 2001.0 NaN outdoor 100 Art Rooney Ave, Pittsburgh, PA 15212 15212 cold 65,500 Grass USW00094823 PITTSBURGH ASOS, PA US 40.4846 -80.2144 366.7
1 Alamo Dome San Antonio, TX NaN NaN indoor 100 Montana St, San Antonio, TX 78203 78203 dome 72000 FieldTurf NaN NaN NaN NaN NaN
2 Allegiant Stadium Paradise, NV 2020.0 NaN indoor NaN NaN dome 65000 Grass NaN NaN NaN NaN NaN
3 Allianz Arena Munich, Germany NaN NaN outdoor NaN NaN moderate 75,024 Grass NaN NaN NaN NaN NaN
4 Alltel Stadium Jacksonville, FL NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
In [4]:
df_teams = pd.read_csv('nfl_teams.csv')

df_teams.head()
Out[4]:
team_name team_name_short team_id team_id_pfr team_conference team_division team_conference_pre2002 team_division_pre2002
0 Arizona Cardinals Cardinals ARI CRD NFC NFC West NFC NFC West
1 Atlanta Falcons Falcons ATL ATL NFC NFC South NFC NFC West
2 Baltimore Colts Colts IND CLT AFC NaN AFC AFC East
3 Baltimore Ravens Ravens BAL RAV AFC AFC North AFC AFC Central
4 Boston Patriots Patriots NE NWE AFC NaN AFC NaN
In [5]:
df_games = pd.read_csv('spreadspoke_scores.csv')

df_games[10:]
Out[5]:
schedule_date schedule_season schedule_week schedule_playoff team_home score_home score_away team_away team_favorite_id spread_favorite over_under_line stadium stadium_neutral weather_temperature weather_wind_mph weather_humidity weather_detail
10 9/11/1966 1966 1 False Pittsburgh Steelers 34 34 New York Giants NaN NaN NaN Pitt Stadium False 64.0 5.0 70.0 NaN
11 9/11/1966 1966 1 False San Francisco 49ers 20 20 Minnesota Vikings NaN NaN NaN Kezar Stadium False 60.0 25.0 75.0 NaN
12 9/11/1966 1966 1 False St. Louis Cardinals 16 13 Philadelphia Eagles NaN NaN NaN Busch Memorial Stadium False 72.0 5.0 70.0 NaN
13 9/11/1966 1966 1 False Washington Redskins 14 38 Cleveland Browns NaN NaN NaN RFK Memorial Stadium False 65.0 8.0 52.0 NaN
14 9/16/1966 1966 2 False Los Angeles Rams 31 17 Chicago Bears NaN NaN NaN Los Angeles Memorial Coliseum False 72.0 10.0 52.0 NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
13511 1/22/2023 2022 Division True Buffalo Bills 10 27 Cincinnati Bengals BUF -6.0 48.5 Highmark Stadium False 32.0 4.0 100.0 snow
13512 1/22/2023 2022 Division True San Francisco 49ers 19 12 Dallas Cowboys SF -3.5 46.5 Levi's Stadium False 55.0 19.0 47.0 NaN
13513 1/29/2023 2022 Conference True Kansas City Chiefs 23 20 Cincinnati Bengals KC -1.5 48 GEHA Field at Arrowhead Stadium False 22.0 13.0 55.0 NaN
13514 1/29/2023 2022 Conference True Philadelphia Eagles 31 7 San Francisco 49ers PHI -2.5 45.5 Lincoln Financial Field False 52.0 14.0 48.0 rain
13515 2/12/2023 2022 Superbowl True Philadelphia Eagles 35 38 Kansas City Chiefs PHI -1.0 51 State Farm Stadium True 76.0 8.0 8.0 retractable (open roof)

13506 rows × 17 columns

With this data set I will clearly be able to draw conclusions based on how accurate the spreads and predictions are and how the game ended up. There is so much data here in regards to what factors may go into a winning team like age of stadium, weather, home turf, what kind of game it is, and how accurate the lines are and whether or not people should make their bets based on that.

Specific Examples to Help Solve the Problem¶

  • We'll cluster the top 5-10 teams from the past 10-20 years and look at how often they were the favorite to win a game, what their spread was, and how much they actually won or lost a game by to test the accuracy of the spread predictions.
  • We'll cluster the top 5-10 teams from the past 10-20 years and look at their win percentages at home vs away vs neutral, as well as look at characteristics of the stadiums of these teams such as indoor/outdoor or how new the stadiums are, even the capacity to see how many fans could attend.
  • We'll cluster the top 5-10 teams from the past 10-20 years and look at what conferences and divisions they are to see if having competitive rivals in their same division or conference is an indicator of success.

As you can see there are endless possibilities with this data set and many ways to look at the different factors going into what makes a winning NFL team. Based on our conclusions, we will be able to make recommendations to those who bet on NFL games and hopefully win some people some money (or at least stop them from losing as much ;)).

teams on a football

In [ ]: