Global warming and the climate of Doom.

A while ago I posted a Python tutorial on the Met Office data set for Oxford in the Uk which goes back to 1850.

The original file was very messy. It was more to do with Pandas and Python rather than a critique of the data in relation to Anthropogenic Global Warming. AGW for short. Climate Change as it is now known.

This little study is based on the temperature data as recorded by the Met office in the UK from 1850 to 2019 in Oxford. That City of Dreaming Spires or City of Insitutionalised Plutocracy. Take your pick. But like Extinction Rebellion, data too has a voice and I would rather listen to what they have to say. Let the data speak for themselves. Is there a correlation between atmospheric levels of a trace gas and the temperature of anywhere measured on the planet?

Our planet has a moon which orbits obliquely round us pulling and pushing our Oceans and affecting our continents as they drift around the surface. And just as well. Without it our planet would be like Mars. Our planet wobbles around its axis and revolves around a star, affected by the forces of gravity from the other planets in our solar system. Our star has its own cycles as it winds around our galaxy. It burns brighter or dims depending on its own peculiar habits. 95 % of our Universe is a dark mystery to us, but still the philosophy of a trace gas is politically used as an excuse to ‘save’ our planet. We have a ‘war’ on climate change.

Like most other of our societal wars, it is one that we cannot win. The planet is 4 billion years old. It doesn’t care about our species. It doesn’t care about any species. In a million years we will be dust in the wind as will every other species in existence right now. That’s life. Whether our species dies out from it’s own hubris or, more likely, from some inter-stellar disaster is immaterial. It will end.

This is a Python blog which lets the data talk.

The link below should render an HTML page from my github page which makes for easier viewing. It uses the github.io page HERE where you can enter the name of your HTML github file and have it rendered in your browser. It works much better for HTML than a simple gist.

Hopefully the following link will be interesting for you both from a Python/Pandas perspective and from a data analysis point of view.

Review of Met Office data for Oxford UK 1850 -2019.

I have also dabbled in how to use CSS in Jupyter Lab cells rather than the woeful Markdown language as well as how best to display HTML files in WordPress.

I have tried to use some interesting code in the presentation. You can format a pandas markdown cell using CSS code to make it more interesting.

<p style='background-color: #99CCCC;
           font-size: 22px;
          font-weight: bold;
           padding: 0.5em 0.5em'>Introduction</p>

Introduction

That code looks like the cell above. Although this may look tedious, you do not have to type all this out for every cell. I copied and pasted and just changed the text.

I also used the ‘folium’ python library to insert interactive maps. My purpose was fairly simple. I just wanted to show where the weather station was located within Oxford. The code is fairly straight forward.

import folium

station = (51.7607,-1.2625)
my_map = folium.Map(location=station,zoom_start=17)
#insert a marker for the weather station
folium.Marker(
    station,
    popup = 'Oxford Weather Station',
    tooltip='Oxford Weather Station'
).add_to(my_map)
my_map

Folium can be used for much more than this simple implementation. If you would like to know more, visit the github page which gives you the information you will need. It really is a great package which can display geographical data in an easy to use (well almost!) format.

If you read through the code, you will find some examples of:

  • Linear regression including R squared values
  • manipulating pandas dataFrames with pivot and group
  • Loads of matplotlib and Seaborn examples
  • One of my favourites print(‘\033[1m’) This makes your following print statements in the jupyter cell print in bold!
  • Kmeans analysis
  • Rolling Averages
  • …………..and more!

More ‘stuff’ can be found at my github page.

I look forward to comments, criticism and suggestions!

1 Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s