Posted on Oct 23, 2020
To meet future demands, fight climate change, decrease reliance on foreign powers, encourage global stability and support the local economy, Spain ought to decrease its dependence on imported fossil fuels and shift focus to take advantage of renewable energy sources available within. According to Eurostat data from 2018, Spain imports a massive 73% of its energy needs, significantly higher than the average of 56% across all 28 EU member states (27 + United Kingdom, Source: Eurostat). Shockingly, for a country renown for its sunshine with largely mediterranean, subtropical, semiarid and desert climate zones, a paltry 4.64% of its electricity comes from solar sources (2.87% solar photovoltaic and 1.77% solar thermal, Source: Eurostat). Therefore, there are a great deal of opportunities for Spain to expand into the solar energy market.
This lack of dependence on solar energy sources is made obvious in the capital city, Madrid. With a population of 3.2 million, yet contains only 209 buildings that are outfitted with photovoltaic solar panels, of which 61 are city buildings (Source: City of Madrid). This is furthermore an embarrassment for the capital as due to climactic factors as well as its elevation (667 m, 2188 ft), it enjoys some of the longest sunshine duration hours in Europe, averaging 2769 hours of sunshine a year, corresponding to around 300 sunny days a year.
As a study of the potential Madrid has to augment its generation of solar power, data from the 61 municipal buildings that contain rooftop solar panel installations was analyzed as a test set. This allowed for the calculation of photovoltaic kilowatt-hours generated (kWh), which was extrapolated to query how much energy could hypothetically be generated across the city given more widespread installation of photovoltaics.


This data visualization is intended to demonstrate to the general public and interested parties the potential benefits of widespread generation of electricity using solar photovoltaics, generally in sunny regions, such as Spain, and more specifically in Madrid. As a rough calculation, extrapolating the data from the 61 municipal buildings gives the following estimated values: The yearly yield of the photovoltaic buildings test set is ~900000 kWh per year, or an average of 15000 kWh per year per building. Extending this for larger implementation to the residential sector, there are ~110000 multi-unit apartment buildings in Madrid, giving a potential to generate 1.65 billion kWh per year. Considering that the energy consumption of the residential sector for 2019 was 4.3 billion kWh, the implementation of photovoltaics in every apartment building in the city could decrease consumption demand from the grid by ~38% per year.


  • Use cadastral data to make more precise predictions regarding the number of potential buildings that could have solar photovoltaic installed (due to roof type, dimensions, construction date, etc.).
  • Present finer monthly analysis of potential solar energy yield and how much that would decrease grid electricity consumption. For example, in summer months sun duration is longer but energy consumption is increased, then how much would the dependence on the grid decrease?
  • Evaluate economic factors, including photovoltaic installation and maintenance costs and current electricity costs in Madrid.
  • Estimate how many tons of carbon dioxide would be prevented from atmospheric release (by month, year) with widespread implementation of photovoltaics.
  • Develop a calculation tool to aid building owners to decide if installation of photovoltaics would be economically feasible.

Check it out here:



About Author

Ryan Kniewel

I have a diverse background in biotechnology and synthetic biology with over 20 years of experience engineering microorganisms using tools from biochemistry, molecular biology, genetics and bioinformatics. I am expanding my knowledge base to address a new range...
View all posts by Ryan Kniewel >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup music Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp