Yu-Gi-OH: The Strongest and the Weakest, a Data Science Perspective

I take things back to my childhood in this article. Online, I found an API for the game Yu-Gi-Oh. Yu-Gi-Oh is a trading card game similar to Magic. When I was growing up, it was one of the major things to play in conjunction with watching the tv show. My friends and I were always arguing with each other. “Which deck type is better?” “Which magic cards were stronger?” “You’re allowed up to 80, but how many cards should you have in your decks?” With the knowledge of data science in my cerebellum, I can now answer some of these questions. However, it would be extremely difficult and time-consuming. Here, we will try to answer an even simpler question. Way back when Yu-Gi-Oh was starting up, it was really about whose cards had higher attack points to vanquish the enemy. I will explore not only the cards with the highest attack points but which monster race has them.

First, we import the necessary libraries to get the Yu-Gi-Oh data we need.

Next, we make the API call using JSON.

Some of the results of the call can be seen below.

Above, we see the JSON for a monster card in Yu-Gi-Oh and the attributes that we’re interested in. You see ‘Atk’ for attack, race: ‘Insect’, and attribute Dark. However, there is plenty of information here we do not need about the card, and the structure of a dictionary isn’t that good for analysis. So we select the attributes that might be helpful for us and work to put the data into a data frame.

From here, I group the cards together by race, calculating the mean of the attacks and defense position amounts. I then loop through to find the max of attack of the race and that designated race. For extra analysis, I looked at the race with the best defense too. From here we can see that if you go to dinosaurs, on average you will have the highest attack of all free summonable monsters in the game. Even if you go hard defense, it would on average not be enough to go against the dinosaurs. The best counter place based upon this knowledge is to focus on higher-level special summon cards and magic cards to help break down your opponent’s fierce aggressive ability. However, if we just care about the best attack monsters in the game the Dinosaur cards seem to be the winner!

Unfortunately, this is only the first step in trying to figure out how to have the best deck. We can increase our analysis to include higher-level monsters, monsters that call for sacrificing weaker cards for stronger ones. This will likely adjust the numbers for the strongest races in both attack and defense. This knowledge is important if you want to make Pyro and Plant races more playable. As seen below, those races have been deemed to have weaker attack and defense points than their peers. The only way to be competitive is by special summoning stronger monsters or winning via magic and trap cards.

--

--