> ## Content Index
> Fetch the complete content index at: https://www.bambooweekly.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Bamboo Weekly #15: Eurovision
- URL: https://www.bambooweekly.com/bw-15-eurovision/
- Published: 2023-05-10T15:00:56.000Z
- Updated: 2026-08-23T09:37:15.000Z
- Description: Get better at: CSV files, plotting with Seaborn, using PyArrow, grouping, and sorting.
- Author: Reuven M. Lerner
- Tags: csv, seaborn, plotting, pyarrow, grouping, sorting

Excited about the festivities and coronation in the United Kingdom? No, not *those*. I’m talking about [Eurovision](https://eurovision.tv/?ref=bambooweekly.com): By the end of this weekend, a new singer will be crowned the best in the world, having won the annual song contest. Each participating country submits one song to the contest each year, and the song which gets the greatest number of votes is declared the winner. The winning country normally hosts the contest the following year; because Ukraine couldn’t host it safely this year, it’s taking place in Liverpool, England.

Eurovision seems to polarize people. Detractors call it kitchy and garish, with terrible music that appeals to people’s worst instincts. To which Eurovision fans respond: Yes, that’s exactly why we love it! Except for Americans, that is, who barely even know that Eurovision exists, except in [the Will Farrell comedy he did for Netflix](https://www.youtube.com/watch?v=7q6Co-nd0lM&ref=bambooweekly.com).

In honor of this week’s Eurovision contest, and in order to cover some positive and happy topics, we’ll be digging through a public data set listing all Eurovision contest entries through 2020.

Moreover, the questions all revolve around plotting. The best-known Python plotting software is [Matplotlib](https://matplotlib.org/?ref=bambooweekly.com), and I cannot deny that it’s quite powerful. However, I find its interface to be frustrating, such that I almost always end up looking through the documentation to do what I want. Moreover, the results are never that aesthetically pleasing. For a long time, I’ve avoided direct use of Matplotlib in favor of the [Pandas plotting interface](https://www.bambooweekly.com/pandas-plot/), which serves as a wrapper around Matplotlib.

Over the last year, I’ve been using another wrapper around Matplotlib, called [Seaborn](http://seaborn.pydata.org/?ref=bambooweekly.com), for my plotting, and I really like it. Seaborn forces you to think about what you’re trying to say with your plots, rather than how you’re trying to draw them. On top of that, it produces a wide variety of plots that look nice without very much customization.

### Data and questions

The data set this week comes from the Eurovision dataset at [https://github.com/Spijkervet/eurovision-dataset/blob/master/README.md](https://github.com/Spijkervet/eurovision-dataset/blob/master/README.md?ref=bambooweekly.com), created by Janne Spijkervet.

We'll be looking one of the CSV files available in that data set, listing all contestants and entry songs. You can most easily retrieve it from [https://github.com/Spijkervet/eurovision-dataset/releases/download/2020.0/contestants.csv](https://github.com/Spijkervet/eurovision-dataset/releases/download/2020.0/contestants.csv?ref=bambooweekly.com).

Here are the questions I want you to answer:

- Read the entire contestant CSV file data into a data frame.
- Create a [line plot](http://seaborn.pydata.org/tutorial/relational.html?ref=bambooweekly.com#relational-tutorial) showing how many countries participated in Eurovision each year. The x axis should show the year, and the y axis should show the number of participants. The plot should have a white background, with grid lines.
- Create a horizontal [bar plot](http://seaborn.pydata.org/tutorial/categorical.html?ref=bambooweekly.com) showing how many times each country participated in Eurovision. The y axis should be the country names (sorted alphabetically), and the x axis should show the number of times they participated.
- Create a new column, winning\_position, which contains a 1, 2, or 3 indicating the final place, and the string "None" otherwise.
- Create a bar plot showing how many times each country won Eurovision. The countries should be sorted alphabetically.
- Create a [strip plot](http://seaborn.pydata.org/tutorial/categorical.html?ref=bambooweekly.com) showing how many votes (points\_final) each country has gotten over the years. There should be one dot per contest. The y axis should be the country names (sorted alphabetically), and the x axis should show the number of votes they got. The color of each dot should reflect whether they got 1st, 2nd, or 3rd place — or no prize at all.
- Create a [scatter plot](http://seaborn.pydata.org/tutorial/relational.html?ref=bambooweekly.com) showing the relationship between the final points granted by phone voters and the final points granted by the juries. Include a regression line in your plot.
- Create [this same plot](http://seaborn.pydata.org/tutorial/distributions.html?ref=bambooweekly.com), but now include histograms along the axes showing the distribution of values.
- Create a scatter plot showing the relationship between the length of a song's lyrics and its place in the final. Should songwriters aim for shorter or longer songs? (Or does it make no difference?)
- Create a boxplot showing the distribution of points for final points.
- Create a [histogram](http://seaborn.pydata.org/tutorial/distributions.html?ref=bambooweekly.com) showing the number of final points first-place songs received over the years.

If you’re like me, then you’ll find that Seaborn challenges your thinking about plotting, while simultaneously making it easier than ever to create nice visualizations. And hey, if you can learn something about Eurovision as well, then all the better.

Suggestions? Comments? Thoughts? Leave a comment!

I’ll be back tomorrow with my solutions.

Reuven