image_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

df = pd.read_csv('../input/fifa19/data.csv')

df.drop(df.columns.difference(['ID', 'Name', 'Age', 'Photo', 'Nationality', 'Position', 'Overall', 'Potential', 'Club', 'Composure', 'Dribbling', 'GKDiving', 'GKHandling', 'GKKicking', 'GKPositioning', 'GKReflexes', 'Joined', 'Wage', 'Preferred Foot', 'International Reputation']), 1, inplace=True)

df.shape

df.columns

def club(x):
    return df[df['Club'] == x][['Name', 'Position', 'Overall', 'Nationality', 'Age']]
club('Tottenham Hotspur')

x = club('Tottenham Hotspur')
x.shape

df.isnull().sum()

plt.rcParams['figure.figsize'] = (10, 5)

labels = ['1', '2', '3', '4', '5']
sizes = df['International Reputation'].value_counts()
colors = plt.cm.copper(np.linspace(0, 1, 5))
explode = [0.1, 0.1, 0.2, 0.5, 0.9]
plt.rcParams['figure.figsize'] = (9, 9)

#Используем диаграмму countplot и выводим данные
p = sns.countplot(x='Position', data=df)
_ = plt.setp(p.get_xticklabels(), rotation=90)

#Используем диаграмму countplot и выводим данные
fig = plt.figure(figsize=(25, 10))
p = sns.countplot(x='Nationality', data=df)
_ = plt.setp(p.get_xticklabels(), rotation=90)

x = df.Age
plt.figure(figsize=(15, 8))
ax = sns.distplot(x, bins=58, kde=False, color='g')
ax.set_xlabel(xlabel='Возраст футболистов', fontsize=16)
ax.set_ylabel(ylabel='Количество футболистов', fontsize=16)
ax.set_title(label='Гистограмма возраста футболистов', fontsize=20)
plt.show()