# initial imports
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
fifa = pd.read_csv('datasets/players_21.csv')
fifa.head()
for col in fifa.columns:
print(col)
fifa.shape
fifa['nationality_name'].value_counts()
fifa['nationality_name'].value_counts()[0:10]
top_5_countries = fifa['nationality_name'].value_counts()[0:5]
top_5_countries
plt.figure(figsize=(8,5))
plt.bar(list(top_5_countries.keys()), list(top_5_countries))
plt.show()
player_salaries = fifa[['short_name', 'wage_eur', 'club_name']]
player_salaries = player_salaries.sort_values(by=['wage_eur'], ascending=False)
player_salaries.head()
top_10_highest_paid = player_salaries[0:10]
top_10_highest_paid
plt.figure(figsize=(10,5))
plt.bar(list(top_10_highest_paid['club_name'].value_counts().keys()), list(top_10_highest_paid['club_name'].value_counts()))
plt.show()
player_values = fifa[['short_name', 'value_eur', 'club_name']]
player_values = player_values.sort_values(by=['value_eur'], ascending=False)
player_values['Millions_EUROS'] = player_values['value_eur'] / 1000000
player_values.head()
top_10_most_expensive = player_values[0:10]
top_10_most_expensive
plt.figure(figsize=(15,10))
plt.bar(list(top_10_most_expensive['club_name'].value_counts().keys()), list(top_10_most_expensive['club_name'].value_counts()))
plt.show()
Porto = fifa[fifa['club_name'] == 'FC Porto']
Porto