NBA -- Home vs Away

Adeel SyedAdeel Syed
1 min read

Purpose of Code

These were the first steps to my NBA project. When I first started this project I decided to use statMuse because it was the easiest website to scrape away vs home games from. The purpose of this code was to just compare their home stats vs their away stats to see if they play better under pressure or worse. Of course, this can be easily done by just looking at their stats, however this was a great project to further my understanding of web drivers and scrapers.

Running the Code

Prompt:

What Player: (abbreviations and misspellings accepted):

Output interpretation:

Percent change of home vs. away stats:

  • Positive value: Player performs better at away.

  • Negative value: Player performs worse away.

Example:

Conclusion

Overall this was one of my first big projects I worked on using Selenium and BeautifulSoup, so it was a great learning experience. However, this doesn't give any real statistical analysis so I've decided to add on the code to give it some statistical value that you can't just find from the front page of Google.

Stay tuned for the expanded version of this project where I will be using Z-Score and standard deviation to find statistical anomalies in player data!

https://github.com/AdeelSyed897/NBA_Stats/blob/main/NBA.py

11
Subscribe to my newsletter

Read articles from Adeel Syed directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Adeel Syed
Adeel Syed

Hi! My name is Adeel Syed and I am currently a senior at Westlake High School. I am mainly a self-taught coder, but I have taken some java classes at Westlake. Feel free to contact me at adeelsyed2004@gmail.com!