text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

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

import seaborn as sns

import seaborn as sns

inex = pd.read_csv('../input/incomeexpendmerged/MergedNew.csv')

inex.dtypes

leagues5 = inex.groupby(by=['League', 'Year'])['Expenditure', 'Arrivals', 'Income', 'Depatures', 'Balance'].sum()

leagues11 = inex[(inex['League'] == 'LaLiga') | (inex['League'] == 'Premier League') | (inex['League'] == 'Serie A') | (inex['League'] == 'Ligue 1') | (inex['League'] == 'Bundesliga')]
leagues11

#Number of Players Transfered per league last 12 years
f, ax1 = plt.subplots(figsize=(15, 8))
sns.set_style('whitegrid')

ax1 = sns.barplot(y = 'Arrivals' , x = 'Year',hue = 'League', data  =  leagues11,estimator = sum, ci = False, 
                  palette = sns.color_palette("husl",5) )
ax1.bar_label(ax1.containers[2], color = 'black', size = 15)
#ax1.bar_label(ax1.containers[3], color = 'black', size = 9)
ax1.tick_params(labelsize = 15)

plt.xticks(rotation = 0, size =  15)
plt.yticks(size =  15)
plt.xlabel('Year', size =  18)
plt.ylabel('Number of Transfers', size = 18)
plt.title('Total Number of Players Transfered Per League [2011 to 2022]', size = 20)

#Bar Plot
import seaborn as sns

#palette =  sns.color_palette(['darkblue','red','green','yellow','pink'])
sns.set(rc={'figure.figsize':(15,8)})
sns.set_style('whitegrid')
plot = sns.barplot(y = 'Expenditure' , x = 'Year', 
            data  =  leagues11, estimator = sum,
            hue = 'League' ,ci = False, palette = sns.color_palette("husl", 5))
plot1 = plot.get_figure()
plt.xlabel('Year', size =  15)
plt.ylabel('Transfer Value (Million Euros)', size = 18)
plt.title('Money Spent by Europes Top 5 Leagues [2011 to 2022]', size = 20)

plot1.savefig("BarPlot.png")

sns.set(rc={'figure.figsize': (15, 8)})
sns.set_style('white')
sns.lmplot(y='Expenditure', x='Year', ci=None, data=leagues11[leagues11.League.isin(['Serie A', 'Premier League', 'LaLiga', 'Bundesliga', 'Ligue 1'])], hue='League', palette=sns.color_palette('husl', 5), col='League', line_kws={'color': 'black', 'lw': 5}, scatter_kws={'s': 200, 'edgecolor': 'black', 'alpha': 0.4})
plt.savefig('LMPlot.jpg')