application_vnd.jupyter.stderr_output_2.png text_plain_output_1.png image_output_1.png
from subprocess import check_output

import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import plotly.plotly as py
from subprocess import check_output
foot = pd.read_csv('../input/epldata_final.csv')

pl_under = foot[foot['age'] <= 21]
def count_u21(pl_under, *args):
    u21_dir = {}
    for col_name in args:
        col = pl_under[col_name]
        for entry in col:
            if entry in u21_dir.keys():
                u21_dir[entry] += 1
            else:
                u21_dir[entry] = 1
        return u21_dir
clubs_ = count_u21(pl_under, 'club')
print(clubs_)
plt.hist(clubs_)
plt.xlabel('Clubs')
plt.ylabel('No. of players')
plt.title('U21 distribution - Clubs')
plt.show()