<jupyter_start><jupyter_text>HeroesLounge-TeamStats This notebook gathers a team's data, computes statistics for its players and maps played, and displays them.\**Instructions**: fill the inputs and execute all cells\**Github**: https://github.com/Anteb-Turtle/HeroesLounge-TeamStats/  InputsTo get a team's data, enter its name and tag, as well as the seasons for which data must be gathered.<jupyter_code>team_name = 'Turtle Team' # enter team complete name
team_tag =  'Turtles' # enter team tag
seasons = [0] #enter seasons of interest (list of integers or list of strings)<jupyter_output><empty_output><jupyter_text>Imports<jupyter_code>%matplotlib inline
import teamclasses as tc
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (12, 9)<jupyter_output><empty_output><jupyter_text>Retreive online data and procces itCreate a raw data object and gather data from the heroeslounge.gg website.<jupyter_code>## Initialize raw data object
team_data = tc.TeamRawData(team_tag, team_name)
team_data.set_seasons(seasons)
## Import data
team_data.gather_online_data()
## Process data: convert to dataframes
team_display = tc.TeamDisplayData(raw_data = team_data)<jupyter_output><empty_output><jupyter_text>StatisticsDisplays statistics as barplots.- Bar heights give the winrate for each hero.- Heroes are orderer from most played to least played.- The number above the bar corresponds to the number of time the hero was played.- The dashed red line correspond to the average winrate.- Suggested bans are highlighted in red: they correspond to heros with winrate at least 10% above average and number of times played above average.  Plot the winrate for the playersSet the argument players to an integer to show the first players in the team, ordered by number of matches played.Set the argument players to a list of strings with the players names to display the stats for these players.<jupyter_code>team_display.display_player_stats(players = 6)<jupyter_output><empty_output><jupyter_text>Plot the winrate for each map<jupyter_code>team_display.display_map_stats()<jupyter_output><empty_output><jupyter_text>Plot the bans made by the team for each map<jupyter_code>team_display.display_map_bans()<jupyter_output><empty_output><jupyter_text>Scatter plot for heroes<jupyter_code>team_display.display_scatter_heroes(player=None, size=12)<jupyter_output><empty_output><jupyter_text>Scatter plot for maps<jupyter_code>team_display.display_scatter_maps(size=12)<jupyter_output><empty_output><jupyter_text>Plotly figures<jupyter_code>import pandas as pd
import plotly.express as px<jupyter_output><empty_output><jupyter_text>By map Color is winrate \Size is number of occurences<jupyter_code>disp1 = pd.melt(team_display.df_map_wr.reset_index(), id_vars=['index'], var_name='hero', value_name='WR')
disp2 = pd.melt(team_display.df_map_played.reset_index(), id_vars=['index'], var_name='hero', value_name='played')
disp3 = pd.melt(team_display.df_bans_map.reset_index(), id_vars=['index'], var_name='hero', value_name='banned')
disp = pd.merge(pd.merge(disp1,disp2, how='outer'),disp3, how='outer')
disp = disp.fillna(0)
disp.groupby(by=['index','hero'], as_index=False).sum()
disp['occurrence'] = disp['played'] + disp['banned']
disp = disp[disp.played != 0]

#plotting
fig = px.scatter(disp, x='hero', y='index', size='occurrence', color='WR')
fig.show()<jupyter_output><empty_output><jupyter_text>By Player Color is winrate \Size is number of occurences<jupyter_code>disp1 = pd.melt(team_display.df_player_wr.reset_index(), id_vars=['index'], var_name='hero', value_name='WR')
disp2 = pd.melt(team_display.df_player_played.reset_index(), id_vars=['index'], var_name='hero', value_name='played')
disp = pd.merge(disp1,disp2, how='outer')
disp = disp.fillna(0)
#disp.groupby(by=['index','hero'], as_index=False).sum()
#disp = disp[disp.played != 0]

#plotting
fig = px.scatter(disp, x='hero', y='index', size='played', color='WR')
fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11613876319758673, 'fraction_numerical': 0.00628456510809452, 'mean_word_length': 7.861915367483296, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '592860', 'license': 'MIT', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1307, 'n_words': 342, 'path': 'TeamStats_notebook.ipynb', 'repo_name': 'Anteb-Turtle/HeroesLounge-TeamStats', 'size': '3978'}