<jupyter_start><jupyter_text>df_clusters.to_csv('./assets/csv/tableau/df_clusters_calc.csv', sep=',')<jupyter_code># players
players = df_all_years.copy()
players.head(2)
players_cluster_1 = players[players.cluster_origin == 1]
teste = players.groupby(['cluster_origin', "icao_carrier", 'sched_year'], as_index=False).agg(
    icao_carrier_count=('icao_carrier', 'count'),
    total_pax=("seats_available", 'sum')
)
airline = {
    'AZU':'Azul',
    'BRB':'Bra',
    'GLO':'Gol',
    'IPM':'Itapemirim',
    'NES':'Nordeste',
    'ONE':'Avianca Brasil',
    'OWT':'Two',
    'PTB':'Passaredo',
    'PTN':'Pantanal',
    'RSL':'Rio Sul',
    'SLX':'Sete',
    'TAM':'Latam',
    'TIB':'Trip',
    'VRG':'VARIG',
    'VRN':'Vrg',
    'VSP':'VASP',
    'WEB':'Webjet',
    'FYW':'FlyWays',
    'NHG':'Brava (former NHT)',
    'NRA':'Noar',
    'PAM':'MAP',
    'TSD':'Taf',
    'TIM':'Team',
    'SBA':'Sol',
    'SUL':'Asta',
    'TTL':'Total'
}
teste["airline"] = teste["icao_carrier"].apply(lambda x: airline[x])
teste
teste.to_csv('./assets/csv/tableau/players_all_years.csv', sep=',')
years = [2002, 2003, 2004, 2005, 2006, 2007, 2008]
mkt_share_flights = players[players.sched_year.isin(years) == False]
mkt_share_flights.head(2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22820919175911253, 'fraction_numerical': 0.025356576862123614, 'mean_word_length': 4.874418604651162, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '666326', 'license': 'MIT', 'n_tokens_mistral': 604, 'n_tokens_neox': 532, 'n_words': 68, 'path': 'CP_05_clusters_03_analysis.ipynb', 'repo_name': 'fealt/ironhack-bootcamp-capstone-project', 'size': '1262'}