Skip to content

NBA Shooting Data

This dataset contains shooting statistics for four different players during the 2021 NBA Playoffs.

Not sure where to begin? Scroll to the bottom to find challenges!

import pandas as pd

data = pd.read_csv("nba_players_shooting.csv", index_col=0)

Data Dictionary

variableclassdescription
SHOOTERStringName of the player taking the shot
XfloatHorizontal distance of the shot taken from the basket in ft
YfloatVertical distance of the shot taken from the basket in ft
RANGEStringRadius range of the shot taken from the basket in ft
DEFENDERStringName of the player defending the shot
SCOREString'MADE' if shot is scored, else 'MISSED'

Source of dataset.

Don't know where to start?

Challenges are brief tasks designed to help you practice specific skills:

  • 🗺️ Explore: At what range is each player most likely to score a shot?
  • 📊 Visualize: Plot the shots made by the X and Y position on the court. For each shot, differentiate between the four different players.
  • 🔎 Analyze: Are players more likely to score a shot the closer they get to the basket?

Scenarios are broader questions to help you develop an end-to-end project for your portfolio:

A university basketball team has hired you to use data to improve their performance. They want to know whether it's possible to use past data to provide tailored recommendations to players.

As a test, you have been provided with NBA shooting data for four players. The manager of the university team has asked you whether it is possible to provide data-driven recommendations for each player based on their likelihood of making a shot. You must also include how reliable your findings are, as well as advice for each player.

You will need to prepare a report that is accessible to a broad audience. It will need to outline your steps, findings, and conclusions.

data.info()
dic = { k: str(v) for k,v in data.dtypes.items()}
dic.update({'SHOOTER': 'category', 'DEFENDER': 'category'})
datab = pd.read_csv("nba_players_shooting.csv", dtype={'SHOOTER': 'category', 'DEFENDER': 'category', 'SCORE':'category'}, index_col=0)
datab.info()
import seaborn as sns
sns.countplot(data=datab, x='SHOOTER', hue='SCORE')
sns.countplot(data=datab, x='DEFENDER', hue='SCORE')