<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Visualizing NBA Passing Networks With Python	</title>
	<atom:link href="https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/</link>
	<description></description>
	<lastBuildDate>Wed, 22 Feb 2023 05:12:04 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.7.8</generator>
	<item>
		<title>
		By: Ahmed Cheema		</title>
		<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-6315</link>

		<dc:creator><![CDATA[Ahmed Cheema]]></dc:creator>
		<pubDate>Wed, 22 Feb 2023 05:12:04 +0000</pubDate>
		<guid isPermaLink="false">https://www.thespax.com/?p=3696#comment-6315</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-6314&quot;&gt;Jason Ingersoll&lt;/a&gt;.

The problem is with the headers. Every so often, there&#039;s a change in the headers required to scrape from the NBA stats site. 

You can replace the &lt;code&gt;headers= ...&lt;/code&gt; line with &lt;code&gt;headers = {&#039;Host&#039;: &#039;stats.nba.com&#039;,&#039;Accept&#039;: &#039;application/json, text/plain, */*&#039;,&#039;x-nba-stats-token&#039;: &#039;true&#039;,&#039;User-Agent&#039;: &#039;Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36&#039;,&#039;x-nba-stats-origin&#039;: &#039;stats&#039;,&#039;Origin&#039;: &#039;https://www.nba.com&#039;,&#039;Referer&#039;: &#039;https://www.nba.com/&#039;,&#039;Accept-Encoding&#039;: &#039;gzip, deflate, br&#039;,&#039;Accept-Language&#039;: &#039;en-US,en;q=0.9}&#039;}&lt;/code&gt; and that should make the scrapes work.

There appears to be inconsistency, likely due to some restriction on scraping (i.e. you make too many calls in a short amount of time). Not sure if I ran into that problem in the past, and if so I&#039;m not sure if I had a workaround for it as I haven&#039;t messed with the API in a while. Sometimes this means that the first few calls to &lt;code&gt;requests.get&lt;/code&gt; work, but the code breaks down somewhere in that loop on players and gets stuck forever. You can see this happening if you add prints to the code.

But I was able to run &lt;code&gt;pass_web(&#039;GSW&#039;,&#039;2016-17&#039;,&#039;AST&#039;)&lt;/code&gt; at least once which created a passing network that looked like my examples in this article. ]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-6314">Jason Ingersoll</a>.</p>
<p>The problem is with the headers. Every so often, there&#8217;s a change in the headers required to scrape from the NBA stats site. </p>
<p>You can replace the <code>headers= ...</code> line with <code>headers = {'Host': 'stats.nba.com','Accept': 'application/json, text/plain, */*','x-nba-stats-token': 'true','User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Mobile Safari/537.36','x-nba-stats-origin': 'stats','Origin': 'https://www.nba.com','Referer': 'https://www.nba.com/','Accept-Encoding': 'gzip, deflate, br','Accept-Language': 'en-US,en;q=0.9}'}</code> and that should make the scrapes work.</p>
<p>There appears to be inconsistency, likely due to some restriction on scraping (i.e. you make too many calls in a short amount of time). Not sure if I ran into that problem in the past, and if so I&#8217;m not sure if I had a workaround for it as I haven&#8217;t messed with the API in a while. Sometimes this means that the first few calls to <code>requests.get</code> work, but the code breaks down somewhere in that loop on players and gets stuck forever. You can see this happening if you add prints to the code.</p>
<p>But I was able to run <code>pass_web('GSW','2016-17','AST')</code> at least once which created a passing network that looked like my examples in this article. </p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jason Ingersoll		</title>
		<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-6314</link>

		<dc:creator><![CDATA[Jason Ingersoll]]></dc:creator>
		<pubDate>Wed, 22 Feb 2023 04:27:22 +0000</pubDate>
		<guid isPermaLink="false">https://www.thespax.com/?p=3696#comment-6314</guid>

					<description><![CDATA[Do you find that this still works? I&#039;m unable to scrape the NBA.com/stats passing data, it just runs on a loop forever. Did you have this problem and if so how did you fix it? I&#039;m trying to scrape the passing data for a research project and this is very frustrating.]]></description>
			<content:encoded><![CDATA[<p>Do you find that this still works? I&#8217;m unable to scrape the NBA.com/stats passing data, it just runs on a loop forever. Did you have this problem and if so how did you fix it? I&#8217;m trying to scrape the passing data for a research project and this is very frustrating.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ahmed Cheema		</title>
		<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-5288</link>

		<dc:creator><![CDATA[Ahmed Cheema]]></dc:creator>
		<pubDate>Wed, 30 Jun 2021 23:47:54 +0000</pubDate>
		<guid isPermaLink="false">https://www.thespax.com/?p=3696#comment-5288</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-5272&quot;&gt;anna&lt;/a&gt;.

Sorry, all of the code used to scrape the data is in the Github file but I do not have the preprocessed data separated.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-5272">anna</a>.</p>
<p>Sorry, all of the code used to scrape the data is in the Github file but I do not have the preprocessed data separated.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: anna		</title>
		<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-5272</link>

		<dc:creator><![CDATA[anna]]></dc:creator>
		<pubDate>Tue, 22 Jun 2021 09:37:35 +0000</pubDate>
		<guid isPermaLink="false">https://www.thespax.com/?p=3696#comment-5272</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-4513&quot;&gt;Ahmed Cheema&lt;/a&gt;.

Dear Ahmed, is it possible to access the preprocessed data? I saw your github folder but I can&#039;t find the data. I am researcher who would like to use the data to test some methodology. Thank you, Anna]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-4513">Ahmed Cheema</a>.</p>
<p>Dear Ahmed, is it possible to access the preprocessed data? I saw your github folder but I can&#8217;t find the data. I am researcher who would like to use the data to test some methodology. Thank you, Anna</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ahmed Cheema		</title>
		<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-4513</link>

		<dc:creator><![CDATA[Ahmed Cheema]]></dc:creator>
		<pubDate>Fri, 20 Nov 2020 17:54:33 +0000</pubDate>
		<guid isPermaLink="false">https://www.thespax.com/?p=3696#comment-4513</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-4434&quot;&gt;Mitchell Schepps&lt;/a&gt;.

Glad you enjoyed it! I&#039;d be interested to see what you do with it in R, let me know!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-4434">Mitchell Schepps</a>.</p>
<p>Glad you enjoyed it! I&#8217;d be interested to see what you do with it in R, let me know!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mitchell Schepps		</title>
		<link>https://www.thespax.com/nba/visualizing-nba-passing-networks-with-python/#comment-4434</link>

		<dc:creator><![CDATA[Mitchell Schepps]]></dc:creator>
		<pubDate>Tue, 17 Nov 2020 06:11:04 +0000</pubDate>
		<guid isPermaLink="false">https://www.thespax.com/?p=3696#comment-4434</guid>

					<description><![CDATA[Hi! Fellow Data scientist here. Super interesting. I am going to try to recreate your graphs with some further insight in R. Working on your scraping data now!]]></description>
			<content:encoded><![CDATA[<p>Hi! Fellow Data scientist here. Super interesting. I am going to try to recreate your graphs with some further insight in R. Working on your scraping data now!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
