Playing with TFT Champions Dataset in Python

avatar

Today I saw the current champion dataset in Kaggle and immediately started to do some analysis. Playing the game according to specific meta compositions was quite confused for me. The current game compositions are available on many sites, but I was wondering which features lay in the background when they were built. So I thought it would be a good idea to explore the characters dataset.

import numpy as np
import pandas as pd 
import seaborn as sns

After importing libraries and calling the csv file, let's have a look first rows of the dataset.

read_data = pd.read_csv("/kaggle/input/league-of-legends-tftteamfight-tacticschampion/TFT_Champion_CurrentVersion.csv")
data = pd.DataFrame(read_data)
data.head(10)

Screenshot_1.png

We have 12 columns in the data. First, let's sort the columns with numerical values separately. Thus, we will clearly see which attributes of the characters are strong. At this point, we can remove some columns from the dataframe.

dropped_data = data.drop(["cost","skill_name", "skill_cost", "origin", "class"], axis = 1)

columns = ["health","defense","attack","attack_range","speed_of_attack","dps"]

def sorting():
    for i in columns:
        print("Sorting by {}".format(i).title())
        print(dropped_data.sort_values(by = i, ascending = False))
        print()
    
sorting()

The above function will return the tables sorted by "health", "defense", "attack", "attack_range", "speed_of_attack", "dps" columns separately.

Screenshot_2.png

Screenshot_3.png

By separating the data we have according to the origins and looking at the mean of the values ​​in the columns, we can form an opinion about the superiority of the origins.

origin = data.groupby(["origin"]).mean()
origin

Screenshot_5.png

sns.catplot(x="origin", y="health", hue="class", kind="swarm", data=data, height = 9, s = 15);

Screenshot_6.png

We can also arrange the y-axis in the chart above for other columns. This will give us information about the distribution of classes.

Finally, let's create the dataset of the brawler blaster comp, one of the known comps in the game. By applying this to any composition we want, such as cybernetic, mech-sorc, rebel we can get some tips.

# Brawler Blaster Comp Table

blaster = data[data["class"].isin(["['Blaster']"])]
brawler = data[data["class"].isin(["['Brawler']"])]
brawler_blaster = pd.concat([brawler,blaster]).sort_values("cost")
brawler_blaster

Screenshot_7.png



0
0
0.000
2 comments
avatar

I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!

0
0
0.000