The Spanish football league commonly known as La Liga is the first national football league in Spain, being one of the most popular professional sports leagues in the world. It was founded in 1929 and has been held every year since then with the exception of the period (1936–1939) due to the Spanish Civil War. At his foundation, it only consisted of 10 teams. Currently, it is made up of 20 teams quite evenly spread across the country but mainly from the most developed regions: Madrid, Barcelona, and Basque Country. The top four teams are qualified for the Champions League while the three lowest placed teams (positions 18–20) are relegated to the second division. As in most European countries, the winner of the game gets three points and both teams get 1 point if they draw.

This article is a journey through the history of the Spanish league. Analyzing historical data (all classifications from 1929 until 2020), we will be able to answer many questions about La Liga. What teams nearly won La Liga? Do referees favor Real Madrid and Barcelona? Is La Liga becoming too soft? When did Barcelona and Real Madrid’s hegemony start? Since when is Barcelona catching up Real Madrid?

Let’s get started 💜

Image for post

Web data extraction

The historical data of La Liga (from 1929 until 2020) was scraped from Bdfutbol.com. This website contains national and international football rankings.

Histórico de Temporadas. La Liga Española, Premier League, Serie A, Bundesliga, Ligue 1, Primeira…

Primera División (Liga BBVA) desde 1928, Segunda División (Liga Adelante) desde 1930-31, Segunda B desde 1978-79…

www.bdfutbol.com

To scrape the data, we have used BeautifulSoup which is a popular Python library for extracting information from an HTML page. After obtaining all the data, we have stored it in a Pandas data frame for further processing.

The programming code used in this analysis is available here. You can take a look at it as you read the article.

#programming #data-analysis #football #pandas #data-science #data analysis

Analysis of the Spanish football league (La Liga)
1.75 GEEK