gilha / nba-2k23-etl-and-data-analysis

ETL + Exploratory Data Analysis of NBA 2K23 Game's data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NBA 2K23 - ETL and Exploratory Data Analysis

  • As a basketball enthusiast and a passionate data analyst, I took it upon myself to scrape the data for this popular game (it wasn't available online), and conduct an in-depth exploratory analysis using SQL and Python. I utilized various libraries including pandas, re, BeautifulSoup, and selenium to gather and clean the data, and perform various statistical analyses on it.
  • Data scraped from 2kratings.com
  • Explored using Deepnote
  • Using SQL, Python (pandas, re, BeautifulSoup, selenium)
  • Gil Harari - LinkedIn; GitHub; Mail; Phone: +972-52-744-1568

Some random facts:

Attributes:

  • Bucks, Suns, Celtics are in the top of most success-predicting metrics (and Spurs, Rockets, Hornets, Pistons are at the bottom).
  • Jazz are the tallest, heaviest, and slowest team in the NBA. (It also has the lowest overall rating.)
  • Thunder are both 3nd tallest and 2nd leanest out of all 30 teams (i.e. looking for that next KD/Giannis/unicorn).
  • Grizzlies are the #1 hustle team, by a fairly large margin.
  • Mavericks are 27th (4rd lowest) in terms of their average overall rating. [update April 23 - no wonder they did not make it to the playoff!]
  • Warriors, Lakers, 76ers are best 3pt shooters (this beautifully reveales the flaw of averages analysis - having a bunch of slightly-above-average shooters such as the case with the Lakers, doesn't translate to high quality 3pt shooting in real life) (Knicks, Hornets, Clippers are the worst on average - again, it's hilarious that the Clippers, a better 3pt shooting team than the Lakers, are ranked at the bottom!)
    • This metric might be skewed by players who aren't really shooting 3s - i.e. having a 25 3pt shooting ratings vs. a 45 3pt shooting ratings both roughly translates to "not a 3pt shooter", but will impact the data differently.

Nationality:

  • 75% of players are from the United States, 5% from Canada, and the rest is pretty much all-over-the-place
  • Screenshot 2023-04-24 183709
  • A non-US player is more likely to be of a big man archetype: taller, heavier, stronger, less explosive, better interior defender but worst perimeter defender, more skillful in the post, less of a playmaker, etc. (33% of non-us players are centers, while only 13% of US players are centers).

Badges:

  • Badges are special abilities or skills. There are four categories of badges: Finishing, Shooting, Playmaking, and Defensive/Rebounding. Each type of badge provides different benefits and boosts for the player's skills and abilities
  • Zion Williams is the only player with all 16 finishing badges
  • 4 players have all 16 shooting badges - Stephen Curry, Buddy Hield, C.J. McCollum, Devin Booker
  • There's no one with all 16 playmaking badges, but the closest is Luka Doncic, with 15
  • Giannis Antetokounmpo is the only player with all 16 DEF/REB badges
  • The player with the most badges, below an overall rating of 80, is Kyle Lowry
  • Celtics are the team with the highest average of badges per player (followed by Suns, Bucks, Warriors). Spurs are with the lowest average (followed by Rockets, Jazz, Thunder)
  • PGs have a much higher average of badges per player, which makes sense as they are the major holders of "playmaking" badges, while the other badges are not really position-specific
  • Screenshot 2023-04-23 211649
  • Indeed, we can perceive above that the majority of playmaking badges are associated with PGs.
  • We can also see that DEF/REB is positively correlated with bigger positions - let us quickly demonstrate that indeed height is correlated with primary playing positions:
  • Screenshot 2023-04-24 183048
  • A beautifully linear graph.
  • There is a very strong correlation between amount of league experience and the amount of badges of a player (correlation coefficient = 0.776):
  • Screenshot 2023-04-24 105638

Average Player Analysis:

  • The average NBA player is 200cm tall (about 6'6"), a mediocre shooter from all ranges, and generally doesn't really possess qualities which are associated with traditional big men (e.g. strength, playing in the post, interior defense, etc.).

  • A further verification of this observation is that when we test which NBA players are the furthest away from average - centers dominate the list:

  • least avg nba player 2k23

  • And the most average NBA players are...:

  • most avg nba players 2k2023

    • (Yes, the Polish dude that shoots one-handed fts is the most average of 'em all.)
  • We can also be a bit more sophisticated than that, and test how the average player looks like for each position!

  • Starting with the most average PGs:

  • most avg pg

    • Killian Hayes is average? That's awesome!
    • Jamal Murray is average? I always knew something was fishy about that dude. [April 2023 update - he's sneakily good, and most likely underrated]
  • Least average PGs:

  • least avg pg

    • A mix of uniquely talented and of fringely weird players (Ben, I'm looking at you).
  • Most average SGs:

  • most avg sg

  • Least average SGs:

  • least avg sg

  • Most average SFs:

  • most avg sf

    • It all just resonates, to be honest.
  • Least average SFs:

  • least avg sf

  • Most average PFs:

  • most avg pf

    • Sochan got mogged.
  • Least average PFs:

  • least avg pf

  • Most average Cs:

  • most avg c

    • Wiseman is average? That's awesome!
  • Least average Cs:

  • least avg c


Even more random facts:

  • Players with the least accumulative game IQ:
  • lowest iq nba2k23
  • Each draft class approximately dwindles by an exponantial factor:
  • Screenshot 2023-04-23 211556
  • No real difference in average overall rating among different heights:
  • Screenshot 2023-04-23 212104

About

ETL + Exploratory Data Analysis of NBA 2K23 Game's data


Languages

Language:Jupyter Notebook 100.0%