This week's task is to embed charts. This chart looks at the percentage change in the Consumer Price Index (CPI) over a 12 month period. The chart uses an API so will remain up to date.
This chart looks at the percdentage change in prices for each sector of the economy
This chart looks at the amount of CO2 greenhouse gas emissions released in different food industries
The fourth chart looks at the amount of CO2 greenhouse gas emissions released in different UK industries
This weeks task was to create your first chart in vega-lite using downloaded data hosted on your GitHub. This chart looks at the amount of outstanding loan by the IMF adjusted for inflation (indexed using 1984 as the baseline)
This chart looks at the amount of outstanding loan by the IMF as a percentage of world GDP. The world GDP data was sourced from The WorldBank and used to analyse the data of the previous graph in the same file hosted in my GiyHub. When the chart is adjusted this way I conclude that 1984-1985 were the most risky years because they have the highest IMF loan outstanding as a percentage of world GDP.
This week's task was to convert a downloaded data-set into a json format using python so that the data is inline in the Vega-lite code. The left chart shows how C02 emissions from the USA and China have evolved over time and depicts the year China overtook USA. The right chart uses the same data but visualsies it in a stacked area chart with tooltips which allows for precise observation of values and helps visualise the volume of C02 released by both countries.
This week's task was to scrape and clean data from a site using python. I had issues scraping data from individual tables in Wikipedia using python so I had to create a basic html file and copy the individual table code from Wikipedia and then clean the data in python. This chart shows UK public opinion on which party they would vote for during the week Rishi Sunak became prime minister. I chose to scrape from wikipedia becasue it's a very useful site for data.
Click here to see google collab on how to scrape and clean data from wikipedia.
This weeks task was to batch download, using the ONS API, 9 time series data sets and display them as line graphs. I chose to look at the UK's balance of payments concerning goods, services, fuel and food with the world, the EU and non-EU countries.
Click here to see google collab on how to batch download data using an ONS API.
This week's task was to create two map charts (cartograms). These are GeoJson files that use a mercator projection of the UK. The borders outline the parlimentary constituencies of the UK. I sourced the GeoJson file from here. I then used the 2019 general election results by constituency from Wikipedia to show what political party each constituency voted for using party specific colours.
The outbursts from Clara E. Mattei, author of Capital Order, caught my attention during the Geo-Ploitical talk at the Festival of Economics 2022. The book talks about the developement of austere policies in response to WW1 in Britain and Italy. Mattei describes austerity as pure top-down economics that aims to protect the capitalistic system by contracting government spending and presence in the market and ensuring confidence in investors. The two graphs depict the conservative party's attempts of austerity in the UK between 2010 and 2019. The left graph shows that while keeping government consumption expenditure relatively flat they managed to decrease the deficit up untill 2019. The right graph shows that government debt and GDP grew at roughly the same rate until 2020. Overall, the graphs highlight that a) Austerity occured between 2010-2019 and b) it was largely ineffective at alleviating government debt.
This week's task was to use advanced analytics. These charts look at economic relationships involved with the Government. The chart on left is a bubble scatter plot that has four data dimensions that looks at the relationship between tax recieved and benefits given as income support per constituency where the size of each bubble represents population and the colour represents the political affiliaion of each constituency. The data was sourced from the ONS, The Commons Library and wikipedia. The scatter chart on the right looks for any effect of UK Prime Minister resignation announcement on the GBP-Dollar exchange rate using a Regression Discontinuity Design. Data was sourced from the Financial Times.
The top chart is classifying constituencies into Conservative or Labour using supervised learning based on mean total income vs mean employment income. The bottom chart classifies constituencies into conservative or labour using unsupervised learning based on mean total income vs mean employment income. Both confirm the long established hypothesis that the higher your income the more likely you are to vote conservative, particularly in this case if your total income is far greater than your employment income. To see how I used machine learning click here.