MPs Expenses

This is a bit of a step back from the previous analysis in which I delved deeply into the how the categories of expenses changed each year. Sensically, this analysis should come first; it's an initial exploration of the data, looking at some summary statistics with particular focus on the minium and maximum values. There's probably equal parts data carpentry and data visualisation - I'm really enjoying plotly, and it's challenging to fit the shape of the data to that which plotly can easily understand.

As ever, if you have any comments, questions or suggestion, please do write to me!

Initial Data Exploration

These are the imports I'll be using for this analysis. 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 random
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