Tracking players on court

171 views
Skip to first unread message

gmf05

unread,
Apr 26, 2015, 2:33:40 PM4/26/15
to nba...@googlegroups.com
Hey all,

So I've pulled the JSON for NBA play by play data. I wanted to compute simple +\- stats but realized that declaring the players on the floor through quarter changes, etc. Is non-trivial. Just curious, does anyone have a simple workaround for this?

Evan Zamir

unread,
Apr 26, 2015, 2:43:39 PM4/26/15
to gmf05, nba...@googlegroups.com
Like you said, it’s non-trivial.


Sent from Mailbox


On Sun, Apr 26, 2015 at 11:33 AM, gmf05 <gfidd...@gmail.com> wrote:

Hey all,

So I've pulled the JSON for NBA play by play data. I wanted to compute simple +\- stats but realized that declaring the players on the floor through quarter changes, etc. Is non-trivial. Just curious, does anyone have a simple workaround for this?

--
You received this message because you are subscribed to the Google Groups "nbawowy forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+u...@googlegroups.com.
To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.
To view this discussion on the web visit https://groups.google.com/d/msgid/nbawowy/c340e393-5517-4f66-841a-0f74d6e659f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


gmf05

unread,
Apr 26, 2015, 3:18:02 PM4/26/15
to nba...@googlegroups.com
Someone must have solved it to compute +/- at all. Just curious what other people have done.

Evan Zamir

unread,
Apr 26, 2015, 3:25:44 PM4/26/15
to gmf05, nba...@googlegroups.com
Yeah I have solved it. It's the underlying algorithm for my whole site. Basically you know a player is on the court when he performs an action in the play-by-play or is substituted out or in. You just have to write some code to track this state. That is the non-trivial part.


Sent from Mailbox


On Sun, Apr 26, 2015 at 12:18 PM, gmf05 <gfidd...@gmail.com> wrote:

Someone must have solved it to compute +/- at all. Just curious what other people have done.

--
You received this message because you are subscribed to the Google Groups "nbawowy forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+u...@googlegroups.com.
To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.

gmf05

unread,
Apr 28, 2015, 9:34:17 AM4/28/15
to nba...@googlegroups.com, gfidd...@gmail.com
Do you use play-by-play from NBA.com and/or other data? I tried what you describe with NBA.com play-by-play and found that, while it often works, it's not always enough. 

For example, even in JSON format the play-by-play doesn't distinguish between Ben Gordon and Aaron Gordon here (http://www.nba.com/games/20141028/ORLNOP/gameinfo.html).

Jerry Vinokurov

unread,
Apr 28, 2015, 9:53:36 AM4/28/15
to gmf05, nba...@googlegroups.com
So, I use the JSON data from Sports Illustrated to achieve this. The SI data tells you who is on the court to start the game, but not the quarter. From there, you need to keep track of any substitutions. Once a new quarter starts, keep track of any player who is involved in a play or is substituted; once a player has become involved in an event, you know he was on the court to start the quarter. The benefit of the SI JSON data (I don't know about the NBA.com data) is that it references players not just by name but by a unique ID, so you never confuse e.g. Aaron Gordon with Ben Gordon.


For more options, visit https://groups.google.com/d/optout.

Evan Zamir

unread,
Apr 28, 2015, 1:15:36 PM4/28/15
to nba...@googlegroups.com, gfidd...@gmail.com
The SI feed looks great. The fact that it's already json makes it much more convenient than the stuff I've been scraping.
-evan


On Tuesday, April 28, 2015 at 6:53:36 AM UTC-7, grapesmoker wrote:
So, I use the JSON data from Sports Illustrated to achieve this. The SI data tells you who is on the court to start the game, but not the quarter. From there, you need to keep track of any substitutions. Once a new quarter starts, keep track of any player who is involved in a play or is substituted; once a player has become involved in an event, you know he was on the court to start the quarter. The benefit of the SI JSON data (I don't know about the NBA.com data) is that it references players not just by name but by a unique ID, so you never confuse e.g. Aaron Gordon with Ben Gordon.
On Tue, Apr 28, 2015 at 9:34 AM, gmf05 <gfidd...@gmail.com> wrote:
Do you use play-by-play from NBA.com and/or other data? I tried what you describe with NBA.com play-by-play and found that, while it often works, it's not always enough. 

For example, even in JSON format the play-by-play doesn't distinguish between Ben Gordon and Aaron Gordon here (http://www.nba.com/games/20141028/ORLNOP/gameinfo.html).

On Sunday, April 26, 2015 at 3:25:44 PM UTC-4, Evan Zamir wrote:
Yeah I have solved it. It's the underlying algorithm for my whole site. Basically you know a player is on the court when he performs an action in the play-by-play or is substituted out or in. You just have to write some code to track this state. That is the non-trivial part.


Sent from Mailbox


On Sun, Apr 26, 2015 at 12:18 PM, gmf05 <gfidd...@gmail.com> wrote:

Someone must have solved it to compute +/- at all. Just curious what other people have done.

--
You received this message because you are subscribed to the Google Groups "nbawowy forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+u...@googlegroups.com.
To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.
To view this discussion on the web visit https://groups.google.com/d/msgid/nbawowy/fbee60ab-15fe-4cc9-b6af-1e6569f10426%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "nbawowy forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+unsubscribe@googlegroups.com.

To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.

Grant Fiddyment

unread,
Apr 28, 2015, 1:42:33 PM4/28/15
to Evan Zamir, nba...@googlegroups.com

Jerry Vinokurov

unread,
Apr 28, 2015, 1:45:31 PM4/28/15
to Grant Fiddyment, Evan Zamir, nba...@googlegroups.com
Another thing you can do is find the SportVu data by looking at the "Events" on the stats page. There's an API call there that basically gives you every player's position on the court for each event in JSON form.



For more options, visit https://groups.google.com/d/optout.

Evan Zamir

unread,
Apr 28, 2015, 2:36:31 PM4/28/15
to nba...@googlegroups.com, zamir...@gmail.com, gfidd...@gmail.com
Wow, that's awesome.
-evan
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+unsubscribe@googlegroups.com.

To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.

--
You received this message because you are subscribed to the Google Groups "nbawowy forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbawowy+unsubscribe@googlegroups.com.

To post to this group, send email to nba...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbawowy.
Reply all
Reply to author
Forward
0 new messages