Live data from Hacker News

How to create NBA shot charts in Python

savvastjortjoglou.com

21–29 of 29 posts

Re: How to create NBA shot charts in Python

#21
I have a growing interest in statistics, partially coming from a lifelong love of basketball. I am comfortable with Python and have done a few small projects in it. How can I use my Python skill with statistics for more projects like this? Can anyone point me the right way? Does not have to be basketball related at all.

Re: How to create NBA shot charts in Python

#22
post #21

I have a growing interest in statistics, partially coming from a lifelong love of basketball. I am comfortable with Python and have done a few small projects in it. How can I use my Python skill with statistics for more projects like this? Can anyone point me the right way? Does not have to be basketball related at all.

Lots of resources out there!

www.datasciencemasters.org -- comprehensive list of things to learn / explore

www.dataquest.io -- (disclaimer: I'm involved with the company), teaches data science in the browser via projects

Re: How to create NBA shot charts in Python

#23
post #21

I have a growing interest in statistics, partially coming from a lifelong love of basketball. I am comfortable with Python and have done a few small projects in it. How can I use my Python skill with statistics for more projects like this? Can anyone point me the right way? Does not have to be basketball related at all.

Lots of resources out there! www.datasciencemasters.org -- comprehensive list of things to learn / explore www.dataquest.io -- (disclaimer: I'm involved with the company), teaches data science in the browser via projects

Thanks! I will look into both of those tonight.

Re: How to create NBA shot charts in Python

#24
post #2

Statmuse.com has a really nice implementation of this in their natural-language sport statistics engine. You can see an image here http://i.imgur.com/ukganMx.png ...or if you're in the beta, here: https://www.statmuse.com/nba/search?q=michael%20jordan%20sho...

Just watched their video... I can't believe I have never heard of these guys before! Looks like they're translating natural-language into some sort of query language. Are there any well-known methods for doing this kind of thing?

When I first heard of statmuse I had your same question, best I could come up with is "Constructing an Interactive Natural Language Interface for Relational Databases"[1]. If anyone knows more about this I'd be curious to hear about it.

[1]http://www.vldb.org/pvldb/vol8/p73-li.pdf

Edit:

Since this got brought up again I've been searching around a little more and found c-phrase, which looks similar.

https://code.google.com/p/c-phrase/ https://www.youtube.com/watch?v=fWio8bHq4wQ

Re: How to create NBA shot charts in Python

#25
post #2

Statmuse.com has a really nice implementation of this in their natural-language sport statistics engine. You can see an image here http://i.imgur.com/ukganMx.png ...or if you're in the beta, here: https://www.statmuse.com/nba/search?q=michael%20jordan%20sho...

That's incredible.

Re: How to create NBA shot charts in Python

#26

The plots showing the full dataset as a scatter plot on the court are great, and the most useful plots in this post. I also like the outlines of the court (though if I were making these charts I’d draw the court lines in gray or pale orange or something so the data would stand out more). The heat maps are much less useful IMO, because the colors are poorly chosen and the data generalization/binning methods seem kind…

I'm the author, thanks for suggestions on improving the charts, especially regarding the marginal histograms.

Just a couple of questions: What color maps would you use for those kde plots?

I know seaborn by default uses the Freedman-Diaconis rule to create bins for the hexbin plot. But, what suggestions do you have for binning?

Re: How to create NBA shot charts in Python

#27
post #17
post #10

Earlier quoted context omitted.

Always wanted to redesign Basketball Reference. Nothing fancy (I can appreciate that the data is king), just clean it up a bit.

we are in the process of doing a slight graphical upgrade to the sites in the near future to clean them up and make them more mobile friendly. stay tuned!

Good to hear. Great resource either way. I use the site all the time.
Post reply on HN