%load_ext nb_black
import pandas as pd
import numpy as np
import altair as alt
count_df = pd.read_excel("./output/seasonal_popularity.xlsx", index_col=0).fillna("")
count_df["Year"] = count_df["season_readable"].apply(lambda x: x.split()[-1])
count_df
players_found | players_total | players_captured | extra_players_captured | start | stop | version | comment | comment_2 | length | ... | top200_cutoff | top64_cutoff | richness | shannon_diversity | dominance | simpson | pro_players_per_day | top2860_matches_per_day | season_readable | Year | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
season | |||||||||||||||||||||
M2_01 Wolf 2020 | 2905 | 2997 | 96.930264 | 32.846715 | 2020-01-08 | 2020-02-04 | 5.0 | Release Merchants of Ofir | Merchant of Ofir was released before this season | 27 | ... | 9872 | 10061 | 79 | 2.911451 | 0.109716 | 0.890284 | 92.481481 | 25888.740741 | Wolf 2020 | 2020 |
M2_02 Love 2020 | 3984 | 4883 | 81.589187 | 55.561048 | 2020-02-04 | 2020-03-03 | 5.1 | Balance patch | 28 | ... | 9952 | 10117 | 73 | 2.784907 | 0.124585 | 0.875415 | 156.535714 | 27452.571429 | Love 2020 | 2020 | |
M2_03 Bear 2020 | 4772 | 6632 | 71.954162 | 50.689290 | 2020-03-03 | 2020-04-02 | 5.2/5.2.9/6.0 | Balance patch | The Android release happend the end of the season | 30 | ... | 9995 | 10204 | 74 | 2.770397 | 0.123829 | 0.876171 | 204.400000 | 28726.100000 | Bear 2020 | 2020 |
M2_04 Elf 2020 | 6070 | 10209 | 59.457342 | 43.679412 | 2020-04-02 | 2020-05-05 | 6.1 | New Leader Abilities & Start Geralt Journey | Hidden Cache, ... | 33 | ... | 10087 | 10293 | 78 | 2.921609 | 0.105208 | 0.894792 | 294.212121 | 30427.363636 | Elf 2020 | 2020 |
M2_05 Viper 2020 | 5977 | 10079 | 59.301518 | 43.177725 | 2020-05-05 | 2020-06-02 | 6.2 | Balance patch | 28 | ... | 10028 | 10255 | 82 | 2.975021 | 0.106955 | 0.893045 | 342.107143 | 30683.571429 | Viper 2020 | 2020 | |
M2_06 Magic 2020 | 6104 | 9919 | 61.538462 | 45.955518 | 2020-06-02 | 2020-06-30 | 6.3 | Bug Fixes only | 28 | ... | 10002 | 10191 | 79 | 3.028216 | 0.100404 | 0.899596 | 336.392857 | 28304.035714 | Magic 2020 | 2020 | |
M2_07 Griffin 2020 | 7372 | 14791 | 49.841120 | 37.817450 | 2020-06-30 | 2020-08-04 | 7.0 | Release Master Mirror | 35 | ... | 10100 | 10289 | 80 | 3.085621 | 0.092351 | 0.907649 | 408.314286 | 28457.600000 | Griffin 2020 | 2020 | |
M2_08 Draconid 2020 | 7037 | 13800 | 50.992754 | 38.180987 | 2020-08-04 | 2020-09-01 | 7.1 | Start Ciri Journey | 28 | ... | 10061 | 10246 | 83 | 3.043551 | 0.097257 | 0.902743 | 475.000000 | 29894.464286 | Draconid 2020 | 2020 | |
M2_09 Dryad 2020 | 7056 | 14554 | 48.481517 | 35.881649 | 2020-09-01 | 2020-10-01 | 7.2 | Overhaul leader abilities | Removal of Second Wind, Call to Harmony, ... I... | 30 | ... | 10046 | 10183 | 83 | 3.071002 | 0.093658 | 0.906342 | 468.466667 | 28469.766667 | Dryad 2020 | 2020 |
M2_10 Cat 2020 | 6987 | 16011 | 43.638748 | 31.381644 | 2020-10-01 | 2020-10-28 | 7.3 | Overhaul scenarios | All scenarios have doomed | 27 | ... | 10067 | 10176 | 82 | 3.028427 | 0.101374 | 0.898626 | 574.481481 | 34383.148148 | Cat 2020 | 2020 |
M2_11 Mahakam 2020 | 6644 | 16752 | 39.660936 | 27.238699 | 2020-10-28 | 2020-12-08 | 7.4 | Start Alzur Journey | 41 | ... | 10090 | 10216 | 83 | 2.981676 | 0.110916 | 0.889084 | 396.390244 | 23967.073171 | Mahakam 2020 | 2020 | |
M2_12 Wild Hunt 2020 | 7806 | 22464 | 34.748932 | 25.229545 | 2020-12-08 | 2021-01-18 | 8.0 | Release Way of the Witcher | 41 | ... | 10172 | 10313 | 76 | 3.040627 | 0.099488 | 0.900512 | 535.707317 | 28825.682927 | Wild Hunt 2020 | 2020 | |
M3_01 Wolf 2021 | 6197 | 13428 | 46.149836 | 31.576457 | 2021-01-18 | 2021-02-09 | 8.1 | Added Madoc | Single New Card Added | 22 | ... | 10044 | 10295 | 86 | 3.088299 | 0.098081 | 0.901919 | 587.636364 | 36734.136364 | Wolf 2021 | 2021 |
M3_02 Love 2021 | 7119 | 16016 | 44.449301 | 32.373062 | 2021-02-09 | 2021-03-09 | 8.2 | Start Yen Journey | Few minor balance changes | 28 | ... | 10097 | 10325 | 84 | 3.045043 | 0.101261 | 0.898739 | 554.142857 | 32733.107143 | Love 2021 | 2021 |
M3_03 Bear 2021 | 7012 | 13636 | 51.422705 | 38.530067 | 2021-03-09 | 2021-04-01 | 8.3 | 12 New Legendary Cards added | Powerful new cards added and balance changes | 23 | ... | 10026 | 10230 | 86 | 3.086869 | 0.090533 | 0.909467 | 571.130435 | 33304.434783 | Bear 2021 | 2021 |
M3_04 Elf 2021 | 10107 | 16049 | 62.975886 | 54.947305 | 2021-04-01 | 2021-05-06 | 8.4 | Only minor balance changes/bug fixes | 35 | ... | 10102 | 10323 | 83 | 3.124564 | 0.091177 | 0.908823 | 444.257143 | 26966.371429 | Elf 2021 | 2021 | |
M3_05 Viper 2021 | 7771 | 17623 | 44.095784 | 33.265596 | 2021-05-06 | 2021-06-08 | 8.5 | Start Triss Journey | 33 | ... | 10106 | 10300 | 82 | 3.147269 | 0.086137 | 0.913863 | 518.878788 | 28969.212121 | Viper 2021 | 2021 | |
M3_06 Magic 2021 | 10899 | 17442 | 62.487100 | 55.129612 | 2021-06-08 | 2021-07-06 | 9.0 | Price of Power part 1 released | 28 | ... | 10082 | 10278 | 82 | 3.162725 | 0.084816 | 0.915184 | 605.071429 | 31027.214286 | Magic 2021 | 2021 | |
M3_07 Griffin 2021 | 7771 | 16772 | 46.333174 | 35.300460 | 2021-07-06 | 2021-08-03 | 9.1 | Sunset Wanderers | Balance patch | 28 | ... | 10067 | 10287 | 84 | 3.083937 | 0.098090 | 0.901910 | 581.142857 | 30557.250000 | Griffin 2021 | 2021 |
M3_08 Draconid 2021 | 8333 | 17523 | 47.554642 | 37.325240 | 2021-08-03 | 2021-09-02 | 9.2 | Price of Power part 2 released | Start Tissaia Journey | 30 | ... | 10079 | 10281 | 82 | 3.023176 | 0.103806 | 0.896194 | 567.433333 | 30359.100000 | Draconid 2021 | 2021 |
M3_09 Dryad 2021 | 7561 | 17486 | 43.240307 | 32.141392 | 2021-09-02 | 2021-10-05 | 9.3 | Only balance changes/bug fixes | 33 | ... | 10078 | 10250 | 86 | 3.009823 | 0.108551 | 0.891449 | 514.727273 | 28489.545455 | Dryad 2021 | 2021 | |
M3_10 Cat 2021 | 8023 | 14048 | 57.111333 | 46.147658 | 2021-10-05 | 2021-10-28 | 9.4 | New Expansion! Harvest of Sorrow | 23 | ... | 9974 | 10083 | 89 | 3.132842 | 0.091885 | 0.908115 | 589.043478 | 31269.391304 | Cat 2021 | 2021 | |
M3_11 Mahakam 2021 | 9147 | 19902 | 45.960205 | 36.891210 | 2021-10-28 | 2021-12-07 | 9.5 | Start Regis Journey | 40 | ... | 10122 | 10252 | 82 | 2.989644 | 0.110278 | 0.889722 | 485.050000 | 25418.900000 | Mahakam 2021 | 2021 | |
M3_12 Wild Hunt 2021 | 9566 | 21651 | 44.182717 | 35.687297 | 2021-12-07 | 2022-01-13 | 9.6 | 12 New Legendary Cards added | 37 | ... | 10140 | 10271 | 80 | 3.101439 | 0.092863 | 0.907137 | 571.648649 | 28228.135135 | Wild Hunt 2021 | 2021 | |
M4_01 Wolf 2022 | 7607 | 15520 | 49.014175 | 37.496051 | 2022-01-13 | 2022-02-08 | 10.1 | Draft out of early access | 26 | ... | 10093 | 10340 | 84 | 3.012610 | 0.112893 | 0.887107 | 577.692308 | 33976.192308 | Wolf 2022 | 2022 | |
M4_02 Love 2022 | 2972 | 14794 | 20.089225 | 0.938495 | 2022-02-08 | 2022-03-08 | 10.2 | Start Dandelion Journey | 28 | ... | 10068 | 10312 | 79 | 3.030534 | 0.104149 | 0.895851 | 510.500000 | 30441.678571 | Love 2022 | 2022 |
26 rows × 24 columns
popularity_chart = (
alt.Chart(count_df)
.mark_bar()
.transform_calculate(combined_comment="datum.comment + ', ' + datum.comment_2")
.encode(
x=alt.X("season_readable", title="Season", sort=list(count_df.season_readable)),
y=alt.Y("pro_players_per_day", title="Popularity (# Pro Player/Season Length)"),
color="Year",
tooltip=[
alt.Tooltip("pro_players_per_day", title="Popularity", format=".2f"),
alt.Tooltip("length", title="Season Length"),
alt.Tooltip("combined_comment:N", title="Info"),
],
)
)
popularity_chart.properties(width="container").save("./output/popularity_chart.json")
popularity_chart
player_chart = (
alt.Chart(count_df)
.mark_bar()
.transform_calculate(combined_comment="datum.comment + ', ' + datum.comment_2")
.encode(
x=alt.X("season_readable", title="Season", sort=list(count_df.season_readable)),
y=alt.Y("players_total", title="Pro Ranked Players"),
color="Year",
tooltip=[
alt.Tooltip("players_total", title="# Pro Players"),
alt.Tooltip("length", title="Season Length"),
alt.Tooltip("combined_comment:N", title="Info"),
],
)
)
player_chart.properties(width="container").save("./output/pro_player_chart.json")
player_chart