NBA Player Performance Stats
NBA stats data from a website and analyze player performance
@kaggle.iabdulw_nba_player_performance_stats
NBA stats data from a website and analyze player performance
@kaggle.iabdulw_nba_player_performance_stats
The goal of this project was to extract data from an NBA stats website using web scraping techniques and then perform data analysis to create visualizations using Python. The website used was "https://www.basketball-reference.com/", which contains data on players and teams in the NBA. The code for this project can be found on my GitHub repository at "https://github.com/Duggsdaddy/Srihith_I310D.git".
The data was extracted using the BeautifulSoup library in Python, and the data was stored in a Pandas DataFrame. The data was cleaned and processed to remove any unnecessary columns or rows, and the data types of the columns were checked and corrected where necessary.
The data was analyzed using various Python libraries such as Matplotlib, Seaborn, and Plotly to create visualizations like bar graphs, line graphs, and box plots. The visualizations were used to identify trends and patterns in the data.
The project follows ethical web scraping practices by not overwhelming the website with too many requests and by giving proper attribution to the website as the source of the data.
Overall, this project demonstrates how web scraping and data analysis techniques can be used to extract meaningful insights from data available on the internet.
Here's a data dictionary for the table
Player: string - name of the player
Pos (Position): string - position played by the player
Age: integer - age of the player as of February 1, 2023
Tm (Team): string - team the player belongs to
G (Games Played): integer - number of games played by the player
GS (Games Started): integer - number of games started by the player
MP (Minutes Played): integer - total minutes played by the player
FG (Field Goals): integer - number of field goals made by the player
FGA (Field Goal Attempts): integer - number of field goal attempts by the player
FG% (Field Goal Percentage): float - percentage of field goals made by the player
3P (3-Point Field Goals): integer - number of 3-point field goals made by the player
3PA (3-Point Field Goal Attempts): integer - number of 3-point field goal attempts by the player
3P% (3-Point Field Goal Percentage): float - percentage of 3-point field goals made by the player
2P (2-Point Field Goals): integer - number of 2-point field goals made by the player
2PA (2-point Field Goal Attempts): integer - number of 2-point field goal attempts by the player
2P% (2-Point Field Goal Percentage): float - percentage of 2-point field goals made by the player
eFG% (Effective Field Goal Percentage): float - effective field goal percentage of the player
FT (Free Throws): integer - number of free throws made by the player
FTA (Free Throw Attempts): integer - number of free throw attempts by the player
FT% (Free Throw Percentage): float - percentage of free throws made by the player
ORB (Offensive Rebounds): integer - number of offensive rebounds by the player
DRB (Defensive Rebounds): integer - number of defensive rebounds by the player
TRB (Total Rebounds): integer - total rebounds by the player
AST (Assists): integer - number of assists made by the player
STL (Steals): integer - number of steals made by the player
BLK (Blocks): integer - number of blocks made by the player
TOV (Turnovers): integer - number of turnovers made by the player
PF (Personal Fouls): integer - number of personal fouls made by the player
PTS (Points): integer - total points scored by the player
CREATE TABLE nba_data_processed (
"player" VARCHAR,
"pos" VARCHAR,
"age" DOUBLE,
"tm" VARCHAR,
"g" DOUBLE,
"gs" DOUBLE,
"mp" DOUBLE,
"fg" DOUBLE,
"fga" DOUBLE,
"fg_51ab2d" DOUBLE -- FG%,
"n_3p" DOUBLE -- 3P,
"n_3pa" DOUBLE -- 3PA,
"n_3p_d87a85" DOUBLE -- 3P%,
"n_2p" DOUBLE -- 2P,
"n_2pa" DOUBLE -- 2PA,
"n_2p_c8658d" DOUBLE -- 2P%,
"efg" DOUBLE -- EFG%,
"ft" DOUBLE,
"fta" DOUBLE,
"ft_ba25d5" DOUBLE -- FT%,
"orb" DOUBLE,
"drb" DOUBLE,
"trb" DOUBLE,
"ast" DOUBLE,
"stl" DOUBLE,
"blk" DOUBLE,
"tov" DOUBLE,
"pf" DOUBLE,
"pts" DOUBLE
);Anyone who has the link will be able to view this.