maplesyrup by Suihei Koubou is a great WoWS stat tracking website, it tracks how many games a player has played during the last week and some intriguing statistics reflecting these games. That being said, why not gather these data and construct a macroscopic profile regarding a ship of your interest? can’t wait to see how toxic Smolensk is

First thing of course is to gather these data. I used Beautiful Soup and Requests to scrape some raw data I needed, and put them together in a .csv file.

After that, I used pandas to read the .csv file containing all the information you need for this visualization, after that, scatter plot from matplotlib is a pretty neat tool to do the actual visualization, and you can pick some data points you are interested and put them on the plot.

Let’s take a popular Russian light cruiser, Smolensk as an example. First we need to read data from the already gather .csv file.

1
2
3
import pandas as pd
smolensk_df = pd.read_csv("Smolensk_asia_weekly_20190114.csv")
smolensk_df = smolensk_df.sample(frac=1).reset_index(drop=True) # randomize to avoid bias

The header of gathered data looks like this:

1
['rank', 'point', 'clan', 'name', 'href', 'battles', 'win', 'draw', 'lose', 'exp', 'damage', 'warshipsdestroyed', 'aircraftdestroyed', 'basecapture', 'basedefense', 'survived', 'kill /death', 'agrodamage', 'spotdamage', 'ratio']

In this case, I will use ‘ratio’ and ‘survived’ as x and y axis respectively, and use ‘damage’ to define marker size and ‘win’ to define win rate in a scatter plot. (note that I applied np.power() function to the damage column):

1
2
3
4
5
6
scatter_plt = plt.scatter(x=smolensk_df['ratio'],
y=smolensk_df['survived'],
s=np.power(smolensk_df['damage'], 2) / 100000000,
c=smolensk_df['win'],
cmap='viridis',
label=None,)

and finally add legends etc.:

1
2
3
4
5
6
7
8
9
10
11
12
plt.title('Smolensk playerbase')
plt.xlabel('Hit ratio(%)')
plt.ylabel('Survival ratio(%)')
plt.colorbar(label='win rate(%)')
plt.legend(*scatter_plt.legend_elements("sizes",
num=6,
func = lambda x: np.sqrt((x * 100000000))
),
title='Average dmg',
loc='lower left')

plt.show()

And we are finally done. The final scatter plot looks like this: