Lebron James vs Michael Jordan: The Great Debate

Wismy Seide
Web Mining [IS688, Spring 2021]
6 min readFeb 10, 2021

I grew with a found love for basketball. While other sports focus on strength, basketball is all about finesse. The biggest and strongest player may not always be the best. One of the best players height was only 6’6”. His name was Michael Jordan and although he played against 7-foot centers, he used finesse and technique to weave his way through the paint and score on taller defenders. Some people will claim that Michael Jordan is the best player ever to play in the NBA.

I am 32 years old and while I did see Michael Jordan play, he started years before I was even born. It is hard to find to footage of these games. One would say this current generation best player is LeBron James. Lebron James entered the NBA while I was in high school, so I remember watching his highlights, his championship wins, and his dominance on the court.

The question of this analysis is who the best is. Is it Lebron or is it Michael Jordan? What am I going to do is gather their career data and see what the data say. Although they never played in the same season, they both have played over 1000 games. We don’t have to speculate about opinion or have what I like to call a barbershop debate because we know can extract the data needed to come to a conclusion.

This exploratory data analysis report was created using NBA API. Although I considered other APIs that were linked to the NBA, a lot of articles point that this is a very detailed API and it is constantly being updated. When I looked up the last game that Lebron played, it showed games played this month already. This was very important to gather accurate information because Lebron James is still an active player in the NBA.

Using this data, exploratory analysis was performed to understand that if players played more games or started more games, they would have a higher average.

If this is your first time running, you can use pip install nbi_api in your Terminal or the Command Prompt. I am using Spyder in Anaconda. I found that Spyder was easy to execute, run, and display the data that I wanted to see.

I created a player dictionary from the line player_dict = players.get_players(). It provides every player that the NBA API has access to. Each dictionary has player full name, ID, and an is_active to determine whether or not they are active.

Next I created a team dictionary from the line from nba_api.stats.static import teams. Now I have a list of the team abbreviation, city, full name, ID, nickname, and year founded.

Now to get player specific data

Lebron James

Ran a For Loop to pull Lebron James specifically to find his id

Michael Jordan

Ran a For Loop for Michael Jordan to get his id

Next, I wanted to pull data from the games that Lebron played in. First, I ran into issues to get all the data from all the seasons. I had to refer to the documentation and with SeasonAll was able to find the data.

I got the data for Lebron James and it was able to pull in successfully.

I was then able to pull up the same stats for the games that Michael Jordan played in his entire career.

Now that I have my subset of data I can begin my analysis:

Lebron James averages:

Michael Jordan averages:

Everyone usually looks at points per game. How many points did each player contribute per game? The best players are considered the players that contribute the highest average. We cannot just look at the points per game to determine impact. Michael Jordan has a 3-point margin over Lebron in points per game. Michael Jordan also has a slight margin in blocks and steals. So, the data would assume that Michael is the better offensive and defensive player.

But we can dive a little bit further. It appears that Lebron takes less shots than Michael Jordan. Lebron takes about 3 shots less than Jordan and his field goal average is slightly better. Lebron also beats out Michael in assists and in rebounds. Assist and rebounds contribute to the term: all around player. It shows a player being able to be effective on both ends of the floor.

So, what is the determining factor. One of the most important factors are plus-minus. In basketball it is used to measure a player’s impact on the game, represented by the difference between their team’s total scoring versus their opponent’s when the player is in the game. This is what I am going to use as a determining factor on this debate. Michael Jordan plus minus is 4.7 while Lebron is 5.4. This single statistical category shows that Lebron has a bigger impact then Michael Jordan when he is on the floor playing with his teammates. We can look at Jordan scoring more points, getting more steals and blocks, but Lebron plus minus is better than Michael Jordan.

Some bugs I encountered was that when working with this, I first started using Jupyter which is what I was familiar with from previous course. I was having a hard time trying to get the API from Jupyter, so I then started using Spyder. After watching a few tutorials on how to import data, where to look at the variables, I was able to successfully pull the NBA API information. There was a lot of misspelling on my part and the console was able to point that out. Another bug I found was that season was set to years, but an NBA season takes place in two different years. I would need to a way to get the data accurately if I were comparing seasons.

To make the calls correctly, I needed to know what I was searching for. Luckily, I picked an API with great documentation. The documentation showed where the data was housed and how to easily retrieve them. I may use this in future work as the data is clean and very sufficient. The hardest part was learning how to narrow it down to a specific player. It took a lot of research and testing to get this accomplished.

My scrapping was limited because I do not know how to plot these well to make visual graphs. Once I learn how to display these visual data well, I will be able to give a better answer to this argument. I will also be able to add other players to the argument such as Kobe Bryant, Kevin Durant, and Steph Curry. This analysis can only get better in the future.

--

--