Dunking on current NBA player statistics with Tableau

Dunking on current NBA player statistics with Tableau

Confession, I don't follow NBA basketball at all. I played organized basketball for many years growing up and have always loved the game. The first time I remember hearing a misleading player statistic was on a bus returning from an away game. The score keeper asked us to guess the player on our team with the highest field goal percentage. Of course most of us guessed our best player. Nobody guessed correctly since it was a backup player who had only taken two shots making both of them for a field goal percentage of 100%!

Why THIS Project?

I chose this project to sharpen my data visualization skills with Tableau while diving into a subject that I used to know, basketball. With a messy text file to start with there was also an opportunity to practice some advanced Excel skills too!

Key Takeaways

  • The best player in the league (statistically) is a center.
  • 3 point percentage statistics can be misleading.
  • Tableau doesn't automatically alternate colors and a border is needed in a stacked bar chart.
  • Point guards and shooting guards are nearly equal league wide in assists.

Dataset Details

The data set from basketball reference is a .csv text file of the current season's player statistics in the NBA as of January 29, 2025. After cleaning I ended up with 525 rows and 31 columns.

Analysis Process

After downloading the data I converted to Excel format and noticed some players repeating. The repeating players have played for two teams this season and for this analysis we want their total statistics represented on their current team not 2TM which is not a real team.


To start, I added a column for a Boolean value to highlight and sort the repeaters with this formula that basically tells Excel to search column B and if the value of B2 shows up more than 1 time highlight it, "=COUNTIF(B:B, B2) > 1". After applying the formula to the whole column I ended up with the result below.


Which real team does the player currently play for? I checked several players and found it was always the third entry in this list. I replaced the 2TM with the current team by adding a new column called current team and using a formula that checks if the value is 2TM then replaces it with the value two rows down as shown below.


The team is now changed but there are still three entries for these players. To get rid of the duplicate player entries I created another player column and used a formula to again count how many times Excel finds a name and change it to an empty cell.

Then filter to select empty cells in that column and delete them.


The Excel file is now ready for Tableau.

Visualization

I started by creating a heat map table on 3pt% by position per team. Mathematically, you cannot use the average of the averages, instead manually create a formula for Tableau "SUM([3P])/SUM([3PA])" in both the value and the color to get this result


We can quickly see that Cleveland's Center has a 0% 3P% while Dallas's has a 100%! If further analysis was desired on this statistic some parameters would need to be added like a minimum attempts (3PA) for example.

Next I decided to graph players points, assists, and total rebounds by position on a bubble chart. I used PTS as the column, AST as the row and TRB as the size of the bubble.


It appears the best all around player is Nikola, a center. Overall it seems centers get the most total rebounds and point guards score the most points while assists are a mixed bag.

Next I created a stacked bar chart of points per team and per player on each team. The columns represent teams, the rows points, and the colors differentiate players. I sorted the teams and players by points in descending order. Initially, it appeared there were teams that had players that scored most of the points. Look at Collin Sexton from Utah below, I=it lools like he scores most of the points.


It turns out he doesn't. I hovered over him and realized he and the two players below him are the same color in the stacked bar so I added a border.


I need to do a deep dive on Tableau's behavior here to find out if there is a way to force colors to not be side by side. For now, the border is effective.

Next, a tree map on assists by position. Color is used to differentiate positions and borders per player.


Finally, I wrapped it all up in a Tableau Story. The ability to add captions and allow the user to scroll through each visualization one at a time is a great feature of Tableau stories.

Main Takeaways

  • Excel is a very useful tool for cleaning small .csv files.
  • Tableau is very powerful in visualizing an otherwise overwhelming amount of numbers for the human eye to find a pattern in.
  • Care needs to be taken with visualizations to avoid confusion in automatic color assignment.

Conclusion

Throughout this project, I learned the importance of focusing on the questions stakeholders are asking and clarifying if more analysis should be done in particular areas to eliminate misleading metrics.

This project has improved my Data Visualization skills, and has piqued my curiosity into how NBA player and team stats could before a head to head matchup!

I’d love to hear your thoughts on this project! Please leave a comment with your insights or questions. If you or someone you know is looking to hire a data analyst, let’s connect—I’m excited to explore new opportunities! Let's connect!

This looks so confusing. ??

回复
Damian Kalinowski

Freelance Data Analyst ? Business Intelligence Specialist ? BI Consultant ? BI Developer ? Data Scientist

1 个月

Data analytics with collaboration of NBA ?? perfection ??

Avery Smith

?? I help people land their first data job (even with no experience) ?? Join 10k+ other analysts & get my newsletter! ??? Host of The Data Career Podcast

1 个月

?? nice work! Love the treemap

要查看或添加评论,请登录

Michael Whaley的更多文章

  • I want to RIDE...and work with DATA!

    I want to RIDE...and work with DATA!

    I love mountain biking! Trails aren't always rideable and the crowd sourced model of updating conditions isn't always…

    12 条评论
  • But are you Satisfied?

    But are you Satisfied?

    Human Resources has always fascinated me. From my very first job at National Record Mart at 16 until now, I’ve enjoyed…

    3 条评论
  • Mining insights with Python

    Mining insights with Python

    Python is awesome! The process for extracting minerals through a flotation process is fascinating! Mining and flotation…

    4 条评论
  • Analyzing Hospital Data: What I Learned from SQL and Tableau

    Analyzing Hospital Data: What I Learned from SQL and Tableau

    In this article, I will share insights from my analysis, particularly focusing on patient hospital stays, the…

    4 条评论
  • Digging into Debt: Where is the 25 Trillion Dollars Owed to the World Bank?

    Digging into Debt: Where is the 25 Trillion Dollars Owed to the World Bank?

    When I first opened a dataset containing over a million rows of information, I felt a mix of excitement and anxiety. It…

    7 条评论
  • Exploring the Palate: How Wine Dominates Food Delivery Sales

    Exploring the Palate: How Wine Dominates Food Delivery Sales

    I’ve always had a passion for food. Whether it’s whipping up a meal at home or dining out, I revel in the flavors and…

    7 条评论

社区洞察

其他会员也浏览了