{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from sympy import *\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import os\n", "\n", "init_printing()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "ssheet = 'gfscg-yejun15-tables.xls'\n", "ddir = r'C:\\Users\\Glenn\\Documents\\Stats\\Oct 2017'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "df1 = pd.read_excel(os.path.join(ddir, ssheet), sheetname='Table 1')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Table 1Unnamed: 1Unnamed: 2Unnamed: 3Unnamed: 4Unnamed: 5Unnamed: 6Unnamed: 7Unnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11
0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
1Operating statement (central government)NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2Year ended JuneNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4NaNNaNNaNNaNSeriesYear ended JuneNaNNaNNaNNaNNaNNaN
5NaNNaNNaNNaNref:2009201020112012201320142015
6NaNNaNNaNNaNGFSA$(million)NaNNaNNaNNaNNaNNaN
7NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", "
" ], "text/plain": [ " Table 1 Unnamed: 1 Unnamed: 2 Unnamed: 3 \\\n", "0 NaN NaN NaN NaN \n", "1 Operating statement (central government) NaN NaN NaN \n", "2 Year ended June NaN NaN NaN \n", "3 NaN NaN NaN NaN \n", "4 NaN NaN NaN NaN \n", "5 NaN NaN NaN NaN \n", "6 NaN NaN NaN NaN \n", "7 NaN NaN NaN NaN \n", "\n", " Unnamed: 4 Unnamed: 5 Unnamed: 6 Unnamed: 7 Unnamed: 8 Unnamed: 9 \\\n", "0 NaN NaN NaN NaN NaN NaN \n", "1 NaN NaN NaN NaN NaN NaN \n", "2 NaN NaN NaN NaN NaN NaN \n", "3 NaN NaN NaN NaN NaN NaN \n", "4 Series Year ended June NaN NaN NaN NaN \n", "5 ref: 2009 2010 2011 2012 2013 \n", "6 GFSA $(million) NaN NaN NaN NaN \n", "7 NaN NaN NaN NaN NaN NaN \n", "\n", " Unnamed: 10 Unnamed: 11 \n", "0 NaN NaN \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 NaN NaN \n", "5 2014 2015 \n", "6 NaN NaN \n", "7 NaN NaN " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1.head(8)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Table 1Unnamed: 1Unnamed: 2Unnamed: 3Unnamed: 4Unnamed: 5Unnamed: 6Unnamed: 7Unnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11
48NaNTotal net acquisition of non-financial assetsNaNNaNSCS01G04Z9999991968.41661.662327.191089.621226.941961.812231.44
49NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
50Net lending(+)/borrowing(-)NaNNaNNaNSCS01G01Z91-304.644-6069.98-17786.7-5026.7-2987.62-1608.35287.794
51NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
52Note: Figures may not sum to totals due to rou...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
53NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
54Symbol:NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
55..figure not availableNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
56NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
57Source: Statistics New ZealandNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", "
" ], "text/plain": [ " Table 1 \\\n", "48 NaN \n", "49 NaN \n", "50 Net lending(+)/borrowing(-) \n", "51 NaN \n", "52 Note: Figures may not sum to totals due to rou... \n", "53 NaN \n", "54 Symbol: \n", "55 .. \n", "56 NaN \n", "57 Source: Statistics New Zealand \n", "\n", " Unnamed: 1 Unnamed: 2 Unnamed: 3 \\\n", "48 Total net acquisition of non-financial assets NaN NaN \n", "49 NaN NaN NaN \n", "50 NaN NaN NaN \n", "51 NaN NaN NaN \n", "52 NaN NaN NaN \n", "53 NaN NaN NaN \n", "54 NaN NaN NaN \n", "55 figure not available NaN NaN \n", "56 NaN NaN NaN \n", "57 NaN NaN NaN \n", "\n", " Unnamed: 4 Unnamed: 5 Unnamed: 6 Unnamed: 7 Unnamed: 8 Unnamed: 9 \\\n", "48 SCS01G04Z999999 1968.4 1661.66 2327.19 1089.62 1226.94 \n", "49 NaN NaN NaN NaN NaN NaN \n", "50 SCS01G01Z91 -304.644 -6069.98 -17786.7 -5026.7 -2987.62 \n", "51 NaN NaN NaN NaN NaN NaN \n", "52 NaN NaN NaN NaN NaN NaN \n", "53 NaN NaN NaN NaN NaN NaN \n", "54 NaN NaN NaN NaN NaN NaN \n", "55 NaN NaN NaN NaN NaN NaN \n", "56 NaN NaN NaN NaN NaN NaN \n", "57 NaN NaN NaN NaN NaN NaN \n", "\n", " Unnamed: 10 Unnamed: 11 \n", "48 1961.81 2231.44 \n", "49 NaN NaN \n", "50 -1608.35 287.794 \n", "51 NaN NaN \n", "52 NaN NaN \n", "53 NaN NaN \n", "54 NaN NaN \n", "55 NaN NaN \n", "56 NaN NaN \n", "57 NaN NaN " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1.tail(10)" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Cat1Cat2Cat3Series Ref2009201020112012201320142015
0RevenueTaxation revenueSCS01G02998999956807.30850352471.43933753933.31061857857.19633861515.57298664549.76867669266.849224
1Sales of goods and servicesSCS01G0214299993809.5169154080.6378084385.7137174741.6797304775.5372784891.8276724821.139875
2Interest incomeSCS01G0214110002082.7081641716.0737182031.7980232102.5679182115.0497472457.4679982563.668891
3Dividend incomeSCS01G021412000897.7910962034.3055421702.4592031258.8446721546.4452311733.6641181660.722494
4Current transfersNaNNaNNaNNaNNaNNaNNaNNaN
5GrantsSCS01G029802600171.989000164.382000173.580000173.904000185.177000214.214000237.911000
6Other current transfersSCS01G029802800988.4632031154.2038761217.2067131025.7564811277.7074061243.7806181061.260812
7Capital transfersNaNNaNNaNNaNNaNNaNNaNNaN
8GrantsSCS01G0299026000.196000NaNNaNNaNNaNNaNNaN
9Other capital transfersSCS01G0299029004.9710002.9130003.04800076.2540007.87700047.21300010.454000
\n", "
" ], "text/plain": [ " Cat1 Cat2 Cat3 \\\n", "0 Revenue Taxation revenue \n", "1 Sales of goods and services \n", "2 Interest income \n", "3 Dividend income \n", "4 Current transfers \n", "5 Grants \n", "6 Other current transfers \n", "7 Capital transfers \n", "8 Grants \n", "9 Other capital transfers \n", "\n", " Series Ref 2009 2010 2011 2012 \\\n", "0 SCS01G029989999 56807.308503 52471.439337 53933.310618 57857.196338 \n", "1 SCS01G021429999 3809.516915 4080.637808 4385.713717 4741.679730 \n", "2 SCS01G021411000 2082.708164 1716.073718 2031.798023 2102.567918 \n", "3 SCS01G021412000 897.791096 2034.305542 1702.459203 1258.844672 \n", "4 NaN NaN NaN NaN NaN \n", "5 SCS01G029802600 171.989000 164.382000 173.580000 173.904000 \n", "6 SCS01G029802800 988.463203 1154.203876 1217.206713 1025.756481 \n", "7 NaN NaN NaN NaN NaN \n", "8 SCS01G029902600 0.196000 NaN NaN NaN \n", "9 SCS01G029902900 4.971000 2.913000 3.048000 76.254000 \n", "\n", " 2013 2014 2015 \n", "0 61515.572986 64549.768676 69266.849224 \n", "1 4775.537278 4891.827672 4821.139875 \n", "2 2115.049747 2457.467998 2563.668891 \n", "3 1546.445231 1733.664118 1660.722494 \n", "4 NaN NaN NaN \n", "5 185.177000 214.214000 237.911000 \n", "6 1277.707406 1243.780618 1061.260812 \n", "7 NaN NaN NaN \n", "8 NaN NaN NaN \n", "9 7.877000 47.213000 10.454000 " ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2 = df1.iloc[5:51].drop(df1.columns[[3]], axis=1).drop(df1.index[[6,7]])\n", "df2.columns = ['Cat1','Cat2','Cat3','Series Ref','2009','2010','2011','2012','2013','2014','2015']\n", "df2.iloc[2,0] = df2.iloc[1,0]\n", "df2.iloc[1,0] = np.nan\n", "df2.loc[42,'Cat1'] = df2.loc[41,'Cat1']\n", "df2.loc[41,'Cat1'] = np.nan\n", "df2.drop([5], inplace=True)\n", "df2.dropna(how='all', inplace=True)\n", "df2 = df2.replace(r'^..$', np.nan, regex=True)\n", "df2.iloc[:,0:3] = df2.iloc[:,0:3].replace(np.nan,'')\n", "df2.reset_index(drop=True, inplace=True)\n", "df2.head(10)" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Cat1Cat2Series Ref2009201020112012201320142015
17Interest expensesSCS01G0324099992293.9956462510.4774133237.8912303621.0833153777.7021843544.4044663668.401912
18Current transfersNaNNaNNaNNaNNaNNaNNaN
19SCS01G0398026001162.1802541129.1795121247.0027701229.7720441337.0659351334.4590381437.686239
20SCS01G039802500719.406880409.617403986.590935698.806298684.937465536.490670499.209258
21SCS01G0398028005224.1030045188.6125915070.2833014791.8402945160.0649635783.3110536127.953388
22Capital transfersNaNNaNNaNNaNNaNNaNNaN
23SCS01G039902600520.746746529.584488639.841230738.801346919.364065493.244962544.859761
24SCS01G039902900456.750000530.82200014051.5850401790.0221801127.872000938.476000437.320000
25Other expensesSCS01G0328099990.0000000.0000000.0000000.0000000.0000000.0000000.000000
26Social benefitsSCS01G03270999928887.17634030831.13165031874.91990032459.79092033179.90300034009.59400035066.681000
27Total operating expensesSCS01G03Z99999966656.81225769710.94801686981.07392175615.98837376994.30395078602.48112280820.685003
28Net operating balanceSCS01G01Z901663.758625-4408.313734-15459.558649-3937.072234-1760.682301353.4569602519.234293
29Net acquisition of non-financial assetsFixed assetsSCS01G0461199994298.8541744039.2491935170.1968303797.5878323786.7343504223.0859474909.352474
30less DepreciationSCS01G04K0099992419.3390352609.3912442906.9872682665.6790442647.5462782736.9300902868.517228
31plus Change in inventoriesSCS01G04Z949999-47.2650008.8934569.117446-86.634993-78.623778-30.61597521.924630
32plus ValuablesSCS01G0461399991.9100001.4880001.4290001.2670001.7840001.4440001.504000
33plus LandSCS01G046141100111.445978204.94032325.08300019.258540138.347973416.70821495.130380
34plus Other non-produced non-financial assetsSCS01G04698999922.79700016.48400028.34900023.82400026.24300088.11400072.046000
35Total net acquisition of non-financial assetsSCS01G04Z9999991968.4031171661.6637282327.1880081089.6233351226.9392671961.8060962231.440256
36Net lending(+)/borrowing(-)SCS01G01Z91-304.644492-6069.977462-17786.746657-5026.695569-2987.621569-1608.349136287.794037
\n", "
" ], "text/plain": [ " Cat1 \\\n", "17 \n", "18 \n", "19 \n", "20 \n", "21 \n", "22 \n", "23 \n", "24 \n", "25 \n", "26 \n", "27 \n", "28 Net operating balance \n", "29 Net acquisition of non-financial assets \n", "30 \n", "31 \n", "32 \n", "33 \n", "34 \n", "35 \n", "36 Net lending(+)/borrowing(-) \n", "\n", " Cat2 Series Ref \\\n", "17 Interest expenses SCS01G032409999 \n", "18 Current transfers \n", "19 SCS01G039802600 \n", "20 SCS01G039802500 \n", "21 SCS01G039802800 \n", "22 Capital transfers \n", "23 SCS01G039902600 \n", "24 SCS01G039902900 \n", "25 Other expenses SCS01G032809999 \n", "26 Social benefits SCS01G032709999 \n", "27 Total operating expenses SCS01G03Z999999 \n", "28 SCS01G01Z90 \n", "29 Fixed assets SCS01G046119999 \n", "30 less Depreciation SCS01G04K009999 \n", "31 plus Change in inventories SCS01G04Z949999 \n", "32 plus Valuables SCS01G046139999 \n", "33 plus Land SCS01G046141100 \n", "34 plus Other non-produced non-financial assets SCS01G046989999 \n", "35 Total net acquisition of non-financial assets SCS01G04Z999999 \n", "36 SCS01G01Z91 \n", "\n", " 2009 2010 2011 2012 2013 \\\n", "17 2293.995646 2510.477413 3237.891230 3621.083315 3777.702184 \n", "18 NaN NaN NaN NaN NaN \n", "19 1162.180254 1129.179512 1247.002770 1229.772044 1337.065935 \n", "20 719.406880 409.617403 986.590935 698.806298 684.937465 \n", "21 5224.103004 5188.612591 5070.283301 4791.840294 5160.064963 \n", "22 NaN NaN NaN NaN NaN \n", "23 520.746746 529.584488 639.841230 738.801346 919.364065 \n", "24 456.750000 530.822000 14051.585040 1790.022180 1127.872000 \n", "25 0.000000 0.000000 0.000000 0.000000 0.000000 \n", "26 28887.176340 30831.131650 31874.919900 32459.790920 33179.903000 \n", "27 66656.812257 69710.948016 86981.073921 75615.988373 76994.303950 \n", "28 1663.758625 -4408.313734 -15459.558649 -3937.072234 -1760.682301 \n", "29 4298.854174 4039.249193 5170.196830 3797.587832 3786.734350 \n", "30 2419.339035 2609.391244 2906.987268 2665.679044 2647.546278 \n", "31 -47.265000 8.893456 9.117446 -86.634993 -78.623778 \n", "32 1.910000 1.488000 1.429000 1.267000 1.784000 \n", "33 111.445978 204.940323 25.083000 19.258540 138.347973 \n", "34 22.797000 16.484000 28.349000 23.824000 26.243000 \n", "35 1968.403117 1661.663728 2327.188008 1089.623335 1226.939267 \n", "36 -304.644492 -6069.977462 -17786.746657 -5026.695569 -2987.621569 \n", "\n", " 2014 2015 \n", "17 3544.404466 3668.401912 \n", "18 NaN NaN \n", "19 1334.459038 1437.686239 \n", "20 536.490670 499.209258 \n", "21 5783.311053 6127.953388 \n", "22 NaN NaN \n", "23 493.244962 544.859761 \n", "24 938.476000 437.320000 \n", "25 0.000000 0.000000 \n", "26 34009.594000 35066.681000 \n", "27 78602.481122 80820.685003 \n", "28 353.456960 2519.234293 \n", "29 4223.085947 4909.352474 \n", "30 2736.930090 2868.517228 \n", "31 -30.615975 21.924630 \n", "32 1.444000 1.504000 \n", "33 416.708214 95.130380 \n", "34 88.114000 72.046000 \n", "35 1961.806096 2231.440256 \n", "36 -1608.349136 287.794037 " ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2.tail(20)" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Cat1Cat2
0RevenueTaxation revenue
1Sales of goods and services
2Interest income
3Dividend income
4Current transfers
5
6
7Capital transfers
8
9
10Other income
11Social security contributions
12Total operating income
13Expenses
14Employee expenses
15Depreciation
16Purchases of goods and services
17Interest expenses
18Current transfers
19
20
21
22Capital transfers
23
24
25Other expenses
26Social benefits
27Total operating expenses
28Net operating balance
29Net acquisition of non-financial assetsFixed assets
30less Depreciation
31plus Change in inventories
32plus Valuables
33plus Land
34plus Other non-produced non-financial assets
35Total net acquisition of non-financial assets
36Net lending(+)/borrowing(-)
\n", "
" ], "text/plain": [ " Cat1 \\\n", "0 Revenue \n", "1 \n", "2 \n", "3 \n", "4 \n", "5 \n", "6 \n", "7 \n", "8 \n", "9 \n", "10 \n", "11 \n", "12 \n", "13 Expenses \n", "14 \n", "15 \n", "16 \n", "17 \n", "18 \n", "19 \n", "20 \n", "21 \n", "22 \n", "23 \n", "24 \n", "25 \n", "26 \n", "27 \n", "28 Net operating balance \n", "29 Net acquisition of non-financial assets \n", "30 \n", "31 \n", "32 \n", "33 \n", "34 \n", "35 \n", "36 Net lending(+)/borrowing(-) \n", "\n", " Cat2 \n", "0 Taxation revenue \n", "1 Sales of goods and services \n", "2 Interest income \n", "3 Dividend income \n", "4 Current transfers \n", "5 \n", "6 \n", "7 Capital transfers \n", "8 \n", "9 \n", "10 Other income \n", "11 Social security contributions \n", "12 Total operating income \n", "13 \n", "14 Employee expenses \n", "15 Depreciation \n", "16 Purchases of goods and services \n", "17 Interest expenses \n", "18 Current transfers \n", "19 \n", "20 \n", "21 \n", "22 Capital transfers \n", "23 \n", "24 \n", "25 Other expenses \n", "26 Social benefits \n", "27 Total operating expenses \n", "28 \n", "29 Fixed assets \n", "30 less Depreciation \n", "31 plus Change in inventories \n", "32 plus Valuables \n", "33 plus Land \n", "34 plus Other non-produced non-financial assets \n", "35 Total net acquisition of non-financial assets \n", "36 " ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2.iloc[:,0:2]" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.8.6" } }, "nbformat": 4, "nbformat_minor": 1 }