<jupyter_start><jupyter_text>Cleaning columns with Currency, height and weight<jupyter_code>df['Wage'] = df['Wage'].replace({'€': '', ',': '', 'K':'000', '\.':''}, regex=True).astype(float)
df['Wage']
df[['Name', 'Wage']].sort_values('Wage',ascending=False).head(20)
df['Release Clause'] = df['Release Clause'].replace({'€': '', ',': '', 'K':'000','M':'000000', '\.':''}, regex=True).astype(float)
df['Value'] = df['Value'].replace({'€': '', ',': '', 'K':'000', 'M':'000000', '\.':''}, regex=True).astype(float)
df['Weight'] = df['Weight'].replace({'kg':''}, regex=True).astype(float)
df['Height'] = df['Height'].replace({'cm':''}, regex=True).astype(float)
df
df.describe()
df.groupby('Club').sum()['Value'].reset_index().sort_values('Value', ascending = False).head(20)
df.groupby('Club').sum()['Wage'].reset_index().sort_values('Wage', ascending = False).head(20)
df.groupby('Club').mean()['Best Overall Rating'].reset_index().sort_values('Best Overall Rating', ascending = False).head(20)<jupyter_output><empty_output><jupyter_text>Best Squad<jupyter_code>positions = df['Best Position'].unique()
positions
best_player = pd.concat([pd.DataFrame(pd.DataFrame(df[df['Best Position'] == positions[i]]).sort_values('Best Overall Rating', ascending=False).iloc[0:1]) for i in range(len(positions))],
          ignore_index=True)
best_player<jupyter_output><empty_output><jupyter_text>Ratio of Wage and Vale vs Overall Rating<jupyter_code>ratings_ratio = df.groupby('Club').mean()[['Best Overall Rating','Value','Wage']].reset_index().sort_values('Best Overall Rating', ascending = False)

ratings_ratio['ratio_wage'] = ratings_ratio['Wage'] / ratings_ratio['Best Overall Rating']
ratings_ratio['ratio_value'] = ratings_ratio['Value'] / ratings_ratio['Best Overall Rating']
ratings_ratio
ratings_ratio.sort_values('ratio_wage', ascending=False).head(10)
ratings_ratio.sort_values('ratio_value', ascending=False).head(10)<jupyter_output><empty_output><jupyter_text>Player with the most potential<jupyter_code>promising_players = df[['ID', 'Name', 'Age','Club','Best Position','Best Overall Rating', 'Potential','Value', 'Wage']]
promising_players['future_growth'] = promising_players['Potential'] - promising_players['Best Overall Rating']
promising_players.sort_values(['future_growth', 'Potential'], ascending = False).head(20)
promising_players.sort_values(['future_growth', 'Potential'], ascending = False)[promising_players['Potential'] > 80].head(20)<jupyter_output>C:\Users\T-Gamer\AppData\Local\Temp/ipykernel_13408/2322751781.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
  promising_players.sort_values(['future_growth', 'Potential'], ascending = False)[promising_players['Potential'] > 80].head(20)
{'fraction_non_alphanumeric': 0.2100656455142232, 'fraction_numerical': 0.02224653537563822, 'mean_word_length': 9.972, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 18, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '163273', 'license': 'MIT', 'n_tokens_mistral': 984, 'n_tokens_neox': 907, 'n_words': 133, 'path': 'EDA.ipynb', 'repo_name': 'rafaelhora/fifa-22-dash', 'size': '2742'}