Does anybody here use Python or R for basketball analytics?

Moderator: Doctor MJ

What programming language do you use for basketball analytics? You may select more than one

Python
9
75%
R
2
17%
Something else (specify in comments)
1
8%
 
Total votes: 12

User avatar
SunDevil
Ballboy
Posts: 12
And1: 11
Joined: Jul 14, 2022
       

Does anybody here use Python or R for basketball analytics? 

Post#1 » by SunDevil » Thu Jul 21, 2022 2:52 am

I recently changed my major to Data Science at Arizona State and I am very interested in applying what I'm learning to NBA basketball and NCAA basketball. I was wondering if anybody here is proficient in Python or R and uses that knowledge for basketball analytics. Those are the 2 languages that I will be learning the most but I'm also interested in hearing about the use of other languages if you use something else for data analysis. We will also be using Tableau for visualization but I haven't gotten to those classes yet.
ANTETOKOUNBROS
Starter
Posts: 2,475
And1: 1,616
Joined: Apr 21, 2009
Location: Jokic's Kitchen
     

Re: Does anybody here use Python or R for basketball analytics? 

Post#2 » by ANTETOKOUNBROS » Thu Jul 21, 2022 9:07 pm

I am in a data science master's program. When I started it was R focused curriculum but last couple years the focus has shifted according to market demand which is generally python and now my classes have reflected this preference. Python/Jupyter etc. However, R is still useful in its own right and I make it a point to still be in practice. That said, the amount of analytical and dataviz python libraries out there and the improved performance and ubiquity over R makes Python a lot more attractive to companies who don't already have an established analytics program.

How far into your program? I am looking to create an nba analytics web app sort of as a project for fun and see if it grows into something useful.
User avatar
SunDevil
Ballboy
Posts: 12
And1: 11
Joined: Jul 14, 2022
       

Re: Does anybody here use Python or R for basketball analytics? 

Post#3 » by SunDevil » Thu Jul 21, 2022 10:57 pm

ANTETOKOUNBROS wrote:I am in a data science master's program. When I started it was R focused curriculum but last couple years the focus has shifted according to market demand which is generally python and now my classes have reflected this preference. Python/Jupyter etc. However, R is still useful in its own right and I make it a point to still be in practice. That said, the amount of analytical and dataviz python libraries out there and the improved performance and ubiquity over R makes Python a lot more attractive to companies who don't already have an established analytics program.

How far into your program? I am looking to create an nba analytics web app sort of as a project for fun and see if it grows into something useful.


That's awesome! Is it at BYU? So far I've only taken base level stuff like Java, SQL, and a little bit of R and Python. Looking forward to next semester because we are supposed to be diving deeper into both languages. Tableau won't come until my Senior year but I'm really looking forward to that too. Let me know if you ever get that web app developed. Would love to check it out.
blabla
Sophomore
Posts: 156
And1: 76
Joined: May 23, 2012

Re: Does anybody here use Python or R for basketball analytics? 

Post#4 » by blabla » Fri Jul 22, 2022 8:15 pm

In my dozen of years in basketball analytics I haven't met a single person that programmed in R and at the same time actually understood any of the important algorithms or function calls
Python, I feel like, often forces you to be more explicit, which in turn, in a way, helps you understand what's really going on
User avatar
SunDevil
Ballboy
Posts: 12
And1: 11
Joined: Jul 14, 2022
       

Re: Does anybody here use Python or R for basketball analytics? 

Post#5 » by SunDevil » Fri Jul 22, 2022 11:53 pm

blabla wrote:In my dozen of years in basketball analytics I haven't met a single person that programmed in R and at the same time actually understood any of the important algorithms or function calls
Python, I feel like, often forces you to be more explicit, which in turn, in a way, helps you understand what's really going on


That's very interesting and good to know thanks! Do you have a degree in data science or a related field?
tsherkin
Retired Mod
Retired Mod
Posts: 78,686
And1: 20,148
Joined: Oct 14, 2003
 

Re: Does anybody here use Python or R for basketball analytics? 

Post#6 » by tsherkin » Tue Aug 16, 2022 8:32 am

blabla wrote:In my dozen of years in basketball analytics I haven't met a single person that programmed in R and at the same time actually understood any of the important algorithms or function calls
Python, I feel like, often forces you to be more explicit, which in turn, in a way, helps you understand what's really going on


R is oddly obfuscated in its way, if that's the right way to phrase that. Something about the syntax of Python is a little more straightfoward, IMHO. I like it more. I've used it for data analysis (including interfacing with Excel's application model), GUIs, network tool development, network scripts, ROIP metadata management, all kinds of stuff. It's pretty versatile, with a wicked set of available, diverse libraries.

EDIT: Nuts, didn't see how long ago the last reply was, sorry.
User avatar
eyriq
Retired Mod
Retired Mod
Posts: 24,524
And1: 6,142
Joined: Mar 25, 2008
Location: #TheLab
Contact:
 

Re: Does anybody here use Python or R for basketball analytics? 

Post#7 » by eyriq » Thu Dec 22, 2022 1:04 am

R is great, especially the tidyverse. My job uses python though and I've come to love the ecosystem. If you want to get some reps in using python for basketball analysis check out the dataquest YouTube channel. Really good project walkthroughs there.
KPT1867
Ballboy
Posts: 25
And1: 18
Joined: Oct 10, 2020
       

Re: Does anybody here use Python or R for basketball analytics? 

Post#8 » by KPT1867 » Thu Dec 29, 2022 4:06 am

SAS
User avatar
narmerguy
Lead Assistant
Posts: 5,577
And1: 3,052
Joined: Dec 27, 2010

Re: Does anybody here use Python or R for basketball analytics? 

Post#9 » by narmerguy » Wed Jan 4, 2023 7:03 am

Are there any large datasets of box scores we could analyze? With player-level data? This one seems to only have team data.

https://www.kaggle.com/datasets/wyattowalsh/basketball

I wanted to look at things like steals, assists, points, 3P%, etc. for specific players and games.
Image
LesGrossman
Head Coach
Posts: 6,158
And1: 4,114
Joined: Mar 24, 2014

Re: Does anybody here use Python or R for basketball analytics? 

Post#10 » by LesGrossman » Mon Jan 16, 2023 11:11 pm

STATA, SPSS, Gretl are good tools for quantitative analysis. R probably too, havent looked into it. For me the problem is more to akquire the data i need now that basketball-reference and nba.com have closed their interfaces (or maybe i'm too dumb to figure out how to extract).
Pray for Israel
Peace in Jerusalem

Fan of the game of Basketball, no matter the team, league or players. Opposed to all sorts of person cult and show/entertainment/marketing over substance.
User avatar
Lanky Gunner
Pro Prospect
Posts: 887
And1: 31
Joined: Jun 30, 2008
Contact:

Re: Does anybody here use Python or R for basketball analytics? 

Post#11 » by Lanky Gunner » Fri Jan 20, 2023 11:58 pm

I use R, but I would recommend using Python. I am in contact with front office folks from more than half the league's teams in a Slack they all hang out in and Python is definitely the preferred language (though there are dissenters, of course).
If you have a hero, look again; you have diminished yourself in some way.

http://www.nbacouchside.com

Return to Statistical Analysis