Star Sports
  • baseball
  • basketball
  • esports
  • football
  • golf
  • mma
  • nfl
  • tennis
  • wwe
No Result
View All Result
Star Sports
  • baseball
  • basketball
  • esports
  • football
  • golf
  • mma
  • nfl
  • tennis
  • wwe
No Result
View All Result
Star Sports
No Result
View All Result
Home basketball

Celtics vs Knicks Match: Top Player Stats and Analysis

admin@cpwss2d by admin@cpwss2d
04/17/2025
in basketball
0
Celtics vs Knicks Match: Top Player Stats and Analysis
320
SHARES
2.5k
VIEWS
Share on FacebookShare on Twitter

Alright, so yesterday I was messing around with some basketball data, trying to pull player stats from the Boston Celtics vs. Knicks game. Thought I’d share how it went down.

You Might Also Like

Preston Pippens Journey: From Start to Stardom

Remember the Jimmy Butler dreads phase? Taking a look back at this unique hairstyle moment in his NBA career.

Quarter time basketball duration matters: Find out why knowing the clock is key to team strategy.

Celtics vs Knicks Match: Top Player Stats and Analysis

First off, I started by looking for a good API. Scraped a couple of websites but they were a pain to deal with. Then I found this free sports API that seemed promising. Signed up and got my API key. Boom! First hurdle cleared.

Next, I fired up my Python environment. I’m a sucker for Jupyter notebooks, so I created a new one. Imported the usual suspects: requests for hitting the API and json for handling the data. Also brought in pandas because, well, dataframes make life easier, right?

Then I crafted my API request. The API doc said I needed the game ID. Dug around on their site and found the ID for the Celtics-Knicks game. Plugged that into my API URL. Looked something like this:

api_url = "*/game/{game_id}/player_stats"

Replaced {game_id} with the actual ID, of course. Then I added my API key as a header. Pretty standard stuff.

Sent the request using *(api_url, headers=headers). Checked the response status code. 200? Awesome. Anything else? Time to debug! Luckily, it was a 200.

Now, the fun part: parsing the JSON response. Used to convert the JSON into a Python dictionary. Poked around the dictionary to see the structure of the data. It was nested, as always. Players were listed under some key like 'player_stats', and each player had a bunch of stats: points, rebounds, assists, the whole shebang.

Extracted the player data into a list of dictionaries. Then I fed that list into . Suddenly, I had a nice, clean dataframe with all the player stats. Sweet!

Celtics vs Knicks Match: Top Player Stats and Analysis

The dataframe was pretty wide, with tons of columns. I only cared about a few key stats: player name, points, rebounds, assists, and maybe steals and blocks. So, I selected those columns from the dataframe. Easy peasy with pandas.

Finally, I printed the first few rows of the dataframe to make sure everything looked right. And it did! Got all the Celtics and Knicks players, with their stats for the game. Felt like a champ.

But, you know, just printing the data to the console isn’t very useful. So, I saved the dataframe to a CSV file using *_csv('celtics_knicks_*', index=False). Now I can import that into Excel or whatever. Done!

That’s pretty much it. Took maybe an hour, including the initial API hunting. Not bad for a little side project. Might try building a little web app to display the stats next. We’ll see.

  • Finding the API: This was the trickiest part. There are tons of sports APIs out there, but finding one that’s free and has the data you need can be tough.
  • Data Cleaning: The API data wasn’t perfectly clean. I had to do some minor cleaning, like renaming columns and handling missing values.
  • Error Handling: Always important to handle potential errors, like API rate limits or invalid game IDs.

What I Learned

This little project reinforced the importance of using the right tools for the job. Pandas made working with the data so much easier. Also, it’s a good reminder that even simple projects can be a lot of fun. Now, if you’ll excuse me, I’m gonna go check the score of the Lakers game.

Previous Post

Preston Pippens Journey: From Start to Stardom

admin@cpwss2d

admin@cpwss2d

Related News

Preston Pippens Journey: From Start to Stardom

Preston Pippens Journey: From Start to Stardom

by admin@cpwss2d
04/17/2025
0

Alright, so today I’m gonna walk you through my experience messing around with Preston Pippen. Heard some buzz about it,...

Remember the Jimmy Butler dreads phase? Taking a look back at this unique hairstyle moment in his NBA career.

Remember the Jimmy Butler dreads phase? Taking a look back at this unique hairstyle moment in his NBA career.

by admin@cpwss2d
04/17/2025
0

Okay, so I decided I wanted to switch things up with my hair. Been seeing Jimmy Butler rocking those dreads,...

Quarter time basketball duration matters: Find out why knowing the clock is key to team strategy.

Quarter time basketball duration matters: Find out why knowing the clock is key to team strategy.

by admin@cpwss2d
04/16/2025
0

Alright, let’s talk about this “quarter time basketball” thing I started doing. It wasn’t some grand plan, really. It just...

Searching for what were Kobe last words: Understanding the available information about the helicopter accident.

by admin@cpwss2d
04/16/2025
0

Okay, so this thing about Kobe Bryant’s last words kept bugging me. You hear about tragedies like that, the helicopter...

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending News

How to Fix Common Problems in Thunderstore Mod Manager: Troubleshooting Tips

How to Fix Common Problems in Thunderstore Mod Manager: Troubleshooting Tips

01/05/2025
2027 NFL Mock Draft Predictions: Top Picks and Rising Stars

2027 NFL Mock Draft Predictions: Top Picks and Rising Stars

11/17/2024
Who is Jennifer Lamorna? Meet the Woman Behind NFL Star Mack Hollins

Who is Jennifer Lamorna? Meet the Woman Behind NFL Star Mack Hollins

12/04/2024

About

The best Premium WordPress Themes that perfect for news, magazine, personal blog, etc.

Categories

  • baseball
  • basketball
  • esports
  • football
  • golf
  • mma
  • nfl
  • tennis
  • wwe

Recent Posts

  • Celtics vs Knicks Match: Top Player Stats and Analysis
  • Preston Pippens Journey: From Start to Stardom
  • baseball
  • basketball
  • esports
  • football
  • golf
  • mma
  • nfl
  • tennis
  • wwe

© 2021 JNews – Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • baseball
  • basketball
  • esports
  • football
  • golf
  • mma
  • nfl
  • tennis
  • wwe

© 2021 JNews – Premium WordPress news & magazine theme by Jegtheme.