MPs Expenses Categories

This analysis looks at the total amount of expenses paid to MPs in the UK and splits this amount by category. This is the first analysis I have done with this dataset. I probably should have done something simpler; looking at summary statistics and the like, but as I was playing around with the data this caught my eye and I ran with it.

As ever, if you have any comments, questions or suggestions, please do say!

If you're viewing this on my Github page, I haven't figured out how to make the plotly charts appear in the page (if it is actually possible!); you can find them on my plotly page.

MP's Expenses - Total Amount Paid by Category

These are the modules I'll import for this analysis. urllib.request interacts with the parliamentary-standards website to download the data. pandas and numpy allow for the manipulation of data, and plotly is the library which I'll be using to visualise the data.

In [1]:
from urllib import request
import pandas as pd
from pandas import Series, DataFrame
import numpy as np
import plotly.offline as pyo
from plotly.graph_objs import *
import plotly.plotly as py
from plotly import tools
pyo.offline.init_notebook_mode() # run at the start of every ipython notebook