{
"cells": [
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"ExecuteTime": {
"end_time": "2017-05-24T15:13:43.919016Z",
"start_time": "2017-05-24T16:13:43.760433+01:00"
},
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from matplotlib import pyplot as plt\n",
"from IPython.display import display\n",
"%matplotlib inline\n",
"plt.rcParams['figure.figsize'] = (20.0, 10.0)\n",
"\n",
"rhi_csv = 'tabula-RHI-beneficiaries-non-domestic-individuals-companies.csv'\n"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"ExecuteTime": {
"end_time": "2017-05-24T15:17:13.882070Z",
"start_time": "2017-05-24T16:17:13.811741+01:00"
},
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"
\n",
" \n",
" \n",
" | \n",
" Company | \n",
" Postcode | \n",
" Type | \n",
" Capacity (kWth) | \n",
" Date | \n",
" Cash | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Aaron Newell | \n",
" BT39 | \n",
" Solid Biomass Boiler | \n",
" 60.0 | \n",
" 2015-09-04 | \n",
" 19084.69 | \n",
"
\n",
" \n",
" 1 | \n",
" Acheson & Glover Precast Ltd | \n",
" BT75 | \n",
" Solid Biomass Boiler | \n",
" 99.0 | \n",
" 2015-11-06 | \n",
" 27600.66 | \n",
"
\n",
" \n",
" 2 | \n",
" Acheson & Glover Precast Ltd | \n",
" BT75 | \n",
" Solid Biomass Boiler | \n",
" 99.0 | \n",
" 2015-11-06 | \n",
" 30507.19 | \n",
"
\n",
" \n",
" 3 | \n",
" Acheson & Glover Precast Ltd | \n",
" BT75 | \n",
" Solid Biomass Boiler | \n",
" 99.0 | \n",
" 2015-11-06 | \n",
" 34416.23 | \n",
"
\n",
" \n",
" 4 | \n",
" Acheson & Glover Precast Ltd | \n",
" BT75 | \n",
" Solid Biomass Boiler | \n",
" 99.0 | \n",
" 2015-07-13 | \n",
" 50543.44 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Company Postcode Type \\\n",
"0 Aaron Newell BT39 Solid Biomass Boiler \n",
"1 Acheson & Glover Precast Ltd BT75 Solid Biomass Boiler \n",
"2 Acheson & Glover Precast Ltd BT75 Solid Biomass Boiler \n",
"3 Acheson & Glover Precast Ltd BT75 Solid Biomass Boiler \n",
"4 Acheson & Glover Precast Ltd BT75 Solid Biomass Boiler \n",
"\n",
" Capacity (kWth) Date Cash \n",
"0 60.0 2015-09-04 19084.69 \n",
"1 99.0 2015-11-06 27600.66 \n",
"2 99.0 2015-11-06 30507.19 \n",
"3 99.0 2015-11-06 34416.23 \n",
"4 99.0 2015-07-13 50543.44 "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Company object\n",
"Postcode object\n",
"Type object\n",
"Capacity (kWth) float64\n",
"Date datetime64[ns]\n",
"Cash float64\n",
"dtype: object"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = pd.read_csv(rhi_csv)\n",
"df['Date'] = pd.to_datetime(df['Date of\\rApplication'], format='%d/%m/%Y')\n",
"df['Cash'] = df['Amount of payments\\rmade to 28 February\\r2017 (£)*'].replace('[£,]','', regex=True).astype(float)\n",
"df.drop(['Date of\\rApplication','Amount of payments\\rmade to 28 February\\r2017 (£)*'], axis=1, inplace=True) \n",
"df.rename(columns={'Business or\\rInstallation\\rLocation':'Postcode', 'Installation\\rCapacity\\r(kWth)':'Capacity (kWth)','Technology Type':'Type','Name':'Company'}, inplace=True)\n",
"display(df.head())\n",
"display(df.dtypes)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"ExecuteTime": {
"end_time": "2017-05-24T15:18:46.613887Z",
"start_time": "2017-05-24T16:18:46.574273+01:00"
},
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Company | \n",
" Postcode | \n",
" Type | \n",
" Capacity (kWth) | \n",
" Date | \n",
" Cash | \n",
"
\n",
" \n",
" \n",
" \n",
" 1157 | \n",
" NaN | \n",
" NaN | \n",
" (GSHP) | \n",
" NaN | \n",
" NaT | \n",
" NaN | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Company Postcode Type Capacity (kWth) Date Cash\n",
"1157 NaN NaN (GSHP) NaN NaT NaN"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df.Postcode.isnull()]"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {
"ExecuteTime": {
"end_time": "2017-05-24T15:19:09.762112Z",
"start_time": "2017-05-24T16:19:09.744219+01:00"
},
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"60295840.10000002"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.Cash.sum()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [conda root]",
"language": "python",
"name": "conda-root-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
},
"latex_envs": {
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 0
},
"nav_menu": {},
"toc": {
"navigate_menu": true,
"number_sections": true,
"sideBar": true,
"threshold": 6,
"toc_cell": false,
"toc_section_display": "block",
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}