In [5]:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
In [6]:
df = pd.read_excel("eurovision_song_contest_1975_2016.xlsx")
df = df[df["(semi-) final"] == "f"]
df = df[["Year", "From country", "To country", "Points"]]
df.head()
Out[6]:
Year From country To country Points
0 1975 Belgium Belgium 0
1 1975 Belgium Finland 0
2 1975 Belgium France 2
3 1975 Belgium Germany 0
4 1975 Belgium Ireland 12
In [7]:
points = df.groupby(by="To country")["Points"].sum()
points = points.sort_values(ascending=False)
points.head()
Out[7]:
To country
Sweden            4035
United Kingdom    3283
Russia            2956
Ireland           2943
France            2854
Name: Points, dtype: int64
In [9]:
plt.rcParams["figure.figsize"] = (12, 4)
plt.figure()
labels = points.index
values = list(points)
X = range(len(points))
plt.xticks(X, labels, rotation="vertical")
ax = plt.axes()
ax.xaxis.set_ticks_position("none")
plt.title("Total points (Finals) in Eurovision from 1975 to 2016")
plt.bar(X, values)
Out[9]:
<Container object of 51 artists>

Spain

Order and points

In [19]:
points.index.get_loc("Spain") + 1, points["Spain"]
Out[19]:
(11, 2254)