{ "cells": [ { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [], "source": [ "df1 = pd.read_csv('Stats/GDP-March-quarter.csv', heade)" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [], "source": [ "df1.rename(columns={'Series_title_2':'Industry', 'Series_title_1':'GDP_measure', 'Series_title_3':'Sector'}, inplace=True)" ] }, { "cell_type": "code", "execution_count": 75, "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", "
Series_referencePeriodData_valueSTATUSUNITSMAGNTUDESubjectGroupGDP_measureIndustrySectorSeries_title_4Series_title_5
0SNEA.SG00NAC00B151972.036990.0FINALDollars6National Accounts - SNA 2008 - SNESeries, Key aggregates, Nominal, Actual, TotalGross Domestic Product - expenditure measureNaNNaNNaNNaN
1SNEA.SG00NAC00B151973.038080.0FINALDollars6National Accounts - SNA 2008 - SNESeries, Key aggregates, Nominal, Actual, TotalGross Domestic Product - expenditure measureNaNNaNNaNNaN
2SNEA.SG00NAC00B151974.039361.0FINALDollars6National Accounts - SNA 2008 - SNESeries, Key aggregates, Nominal, Actual, TotalGross Domestic Product - expenditure measureNaNNaNNaNNaN
3SNEA.SG00NAC00B151975.0310203.0FINALDollars6National Accounts - SNA 2008 - SNESeries, Key aggregates, Nominal, Actual, TotalGross Domestic Product - expenditure measureNaNNaNNaNNaN
4SNEA.SG00NAC00B151976.0311506.0FINALDollars6National Accounts - SNA 2008 - SNESeries, Key aggregates, Nominal, Actual, TotalGross Domestic Product - expenditure measureNaNNaNNaNNaN
\n", "
" ], "text/plain": [ " Series_reference Period Data_value STATUS UNITS MAGNTUDE \\\n", "0 SNEA.SG00NAC00B15 1972.03 6990.0 FINAL Dollars 6 \n", "1 SNEA.SG00NAC00B15 1973.03 8080.0 FINAL Dollars 6 \n", "2 SNEA.SG00NAC00B15 1974.03 9361.0 FINAL Dollars 6 \n", "3 SNEA.SG00NAC00B15 1975.03 10203.0 FINAL Dollars 6 \n", "4 SNEA.SG00NAC00B15 1976.03 11506.0 FINAL Dollars 6 \n", "\n", " Subject \\\n", "0 National Accounts - SNA 2008 - SNE \n", "1 National Accounts - SNA 2008 - SNE \n", "2 National Accounts - SNA 2008 - SNE \n", "3 National Accounts - SNA 2008 - SNE \n", "4 National Accounts - SNA 2008 - SNE \n", "\n", " Group \\\n", "0 Series, Key aggregates, Nominal, Actual, Total \n", "1 Series, Key aggregates, Nominal, Actual, Total \n", "2 Series, Key aggregates, Nominal, Actual, Total \n", "3 Series, Key aggregates, Nominal, Actual, Total \n", "4 Series, Key aggregates, Nominal, Actual, Total \n", "\n", " GDP_measure Industry Sector \\\n", "0 Gross Domestic Product - expenditure measure NaN NaN \n", "1 Gross Domestic Product - expenditure measure NaN NaN \n", "2 Gross Domestic Product - expenditure measure NaN NaN \n", "3 Gross Domestic Product - expenditure measure NaN NaN \n", "4 Gross Domestic Product - expenditure measure NaN NaN \n", "\n", " Series_title_4 Series_title_5 \n", "0 NaN NaN \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 NaN NaN " ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1.head()" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [], "source": [ "df2=df1[['Series_reference', 'GDP_measure','Industry','Sector','Period','Data_value']]" ] }, { "cell_type": "code", "execution_count": 76, "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", "
GDP_measure
0Gross Domestic Product - expenditure measure
171Gross National Expenditure
342Gross Domestic Product - production measure
507Disposable Income - gross
6364Final Consumption Expenditure
6411Gross Fixed Capital Formation
6458Changes in Inventories
7804Exports of Goods
8084Imports of Goods
11777National Income - gross
11963Trading Gain or Loss
12118Domestic Income - gross
12273Investment Income, net
12397Current Transfers and Taxes, net
12521Gross Capital Formation
12739Exports of Goods and Services
12818Exports of Services
12850Imports of Goods and Services
12929Imports of Services
\n", "
" ], "text/plain": [ " GDP_measure\n", "0 Gross Domestic Product - expenditure measure\n", "171 Gross National Expenditure\n", "342 Gross Domestic Product - production measure\n", "507 Disposable Income - gross\n", "6364 Final Consumption Expenditure\n", "6411 Gross Fixed Capital Formation\n", "6458 Changes in Inventories\n", "7804 Exports of Goods\n", "8084 Imports of Goods\n", "11777 National Income - gross\n", "11963 Trading Gain or Loss\n", "12118 Domestic Income - gross\n", "12273 Investment Income, net\n", "12397 Current Transfers and Taxes, net\n", "12521 Gross Capital Formation\n", "12739 Exports of Goods and Services\n", "12818 Exports of Services\n", "12850 Imports of Goods and Services\n", "12929 Imports of Services" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2[['GDP_measure']].drop_duplicates()" ] }, { "cell_type": "code", "execution_count": 77, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Industry
0NaN
1013Agriculture, Forestry and Fishing
1178Mining
1343Primary Industries
1508Manufacturing
1673Electricity, Gas, Water and Waste Services
1838Construction
2003Food Manufacturing
2044Manufacturing (excluding Food Manufacturing)
2075Goods Producing Industries
2240Wholesale trade
2405Retail Trade and Accommodation
2570Transport, Postal and Warehousing
2735Information Media and Telecommunications
2900Financial and Insurance Services
3065Rental, Hiring and Real Estate Services (inclu...
3230Professional, Scientific, Technical, Administr...
3395Public Administration and Safety
3560Education and Training
3725Health Care and Social Assistance
3890Arts, Recreation and Other Services
4055Service Industries
4425Wholesale Trade
4630Rental, Hiring and Real Estate Services
4876Total All Industries
4917Agriculture
4958Forestry and Logging
4999Fishing, Aquaculture and Agriculture, Forestry...
5081Food, Beverage and Tobacco Product Manufacturing
5122Textile, Leather, Clothing and Footwear Manufa...
......
8252Intermediate goods - industrial supplies nes -...
8280Intermediate goods - fuels and lubricants - pr...
8308Intermediate goods - fuels and lubricants - pr...
8336Intermediate goods - parts and accessories of ...
8364Intermediate goods - Total
8392Consumption goods - food and beverages, mainly...
8420Consumption goods - food and beverages, mainly...
8448Consumption goods - transport equipment, non-i...
8476Consumption goods - consumer goods nes - durab...
8504Consumption goods - consumer goods nes - semi-...
8532Consumption goods - consumer goods nes - non-d...
8560Consumption goods - Total
8588Passenger motor cars. BEC 51
8616Petrol and avgas. BEC 321
8644Military and other goods. BEC 7
8672General Government
8704Private Non Profit Organisations Serving House...
8736Households
8768Private Non Profit Organisations and Household...
8800Central Government
8832Local Government
10018Total Expenditure by Households in New Zealand
10668Consumption goods - Low value goods purchased ...
14604Per Capita in New Zealand dollars
16030Percentage change from same period previous year
22851Tradeable direct
22979Non-tradeable direct
23107Tradeable Indirect
23235Non-tradeable Indirect
23615Percentage change from previous period
\n", "

126 rows × 1 columns

\n", "
" ], "text/plain": [ " Industry\n", "0 NaN\n", "1013 Agriculture, Forestry and Fishing\n", "1178 Mining\n", "1343 Primary Industries\n", "1508 Manufacturing\n", "1673 Electricity, Gas, Water and Waste Services\n", "1838 Construction\n", "2003 Food Manufacturing\n", "2044 Manufacturing (excluding Food Manufacturing)\n", "2075 Goods Producing Industries\n", "2240 Wholesale trade\n", "2405 Retail Trade and Accommodation\n", "2570 Transport, Postal and Warehousing\n", "2735 Information Media and Telecommunications\n", "2900 Financial and Insurance Services\n", "3065 Rental, Hiring and Real Estate Services (inclu...\n", "3230 Professional, Scientific, Technical, Administr...\n", "3395 Public Administration and Safety\n", "3560 Education and Training\n", "3725 Health Care and Social Assistance\n", "3890 Arts, Recreation and Other Services\n", "4055 Service Industries\n", "4425 Wholesale Trade\n", "4630 Rental, Hiring and Real Estate Services\n", "4876 Total All Industries\n", "4917 Agriculture\n", "4958 Forestry and Logging\n", "4999 Fishing, Aquaculture and Agriculture, Forestry...\n", "5081 Food, Beverage and Tobacco Product Manufacturing\n", "5122 Textile, Leather, Clothing and Footwear Manufa...\n", "... ...\n", "8252 Intermediate goods - industrial supplies nes -...\n", "8280 Intermediate goods - fuels and lubricants - pr...\n", "8308 Intermediate goods - fuels and lubricants - pr...\n", "8336 Intermediate goods - parts and accessories of ...\n", "8364 Intermediate goods - Total\n", "8392 Consumption goods - food and beverages, mainly...\n", "8420 Consumption goods - food and beverages, mainly...\n", "8448 Consumption goods - transport equipment, non-i...\n", "8476 Consumption goods - consumer goods nes - durab...\n", "8504 Consumption goods - consumer goods nes - semi-...\n", "8532 Consumption goods - consumer goods nes - non-d...\n", "8560 Consumption goods - Total\n", "8588 Passenger motor cars. BEC 51\n", "8616 Petrol and avgas. BEC 321\n", "8644 Military and other goods. BEC 7\n", "8672 General Government\n", "8704 Private Non Profit Organisations Serving House...\n", "8736 Households\n", "8768 Private Non Profit Organisations and Household...\n", "8800 Central Government\n", "8832 Local Government\n", "10018 Total Expenditure by Households in New Zealand\n", "10668 Consumption goods - Low value goods purchased ...\n", "14604 Per Capita in New Zealand dollars\n", "16030 Percentage change from same period previous year\n", "22851 Tradeable direct\n", "22979 Non-tradeable direct\n", "23107 Tradeable Indirect\n", "23235 Non-tradeable Indirect\n", "23615 Percentage change from previous period\n", "\n", "[126 rows x 1 columns]" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2[['Industry']].drop_duplicates()" ] }, { "cell_type": "code", "execution_count": 78, "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", "
Sector
0NaN
6505Private
6552All Sectors
6599General Government
7208Households
\n", "
" ], "text/plain": [ " Sector\n", "0 NaN\n", "6505 Private\n", "6552 All Sectors\n", "6599 General Government\n", "7208 Households" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df2[['Sector']].drop_duplicates()" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [], "source": [ "df3=df2[['Series_reference','GDP_measure','Industry', 'Sector']].drop_duplicates(['GDP_measure','Industry','Sector'])" ] }, { "cell_type": "code", "execution_count": 72, "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", "
Series_referenceGDP_measureIndustrySector
23107SNEQ.SG01RAC34B0113Gross Domestic Product - production measureTradeable IndirectNaN
23235SNEQ.SG01RAC34B0114Gross Domestic Product - production measureNon-tradeable IndirectNaN
23615SNEQ.SG01RSC01B01PCGross Domestic Product - production measurePercentage change from previous periodNaN
31323SNEQ.SG02NAC00P50ZGross Capital FormationTotal All Institutonal SectorsNaN
68812SNEQ.SG02RSC31B15PCGross Domestic Product - expenditure measurePercentage change from previous periodNaN
\n", "
" ], "text/plain": [ " Series_reference GDP_measure \\\n", "23107 SNEQ.SG01RAC34B0113 Gross Domestic Product - production measure \n", "23235 SNEQ.SG01RAC34B0114 Gross Domestic Product - production measure \n", "23615 SNEQ.SG01RSC01B01PC Gross Domestic Product - production measure \n", "31323 SNEQ.SG02NAC00P50Z Gross Capital Formation \n", "68812 SNEQ.SG02RSC31B15PC Gross Domestic Product - expenditure measure \n", "\n", " Industry Sector \n", "23107 Tradeable Indirect NaN \n", "23235 Non-tradeable Indirect NaN \n", "23615 Percentage change from previous period NaN \n", "31323 Total All Institutonal Sectors NaN \n", "68812 Percentage change from previous period NaN " ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df3.tail()" ] }, { "cell_type": "code", "execution_count": 73, "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", "
Series_referenceGDP_measureIndustrySector
0SNEA.SG00NAC00B15Gross Domestic Product - expenditure measureNaNNaN
171SNEA.SG00NAC00B21Gross National ExpenditureNaNNaN
342SNEA.SG00RAC00B01Gross Domestic Product - production measureNaNNaN
507SNEA.SG00RAC00B06Disposable Income - grossNaNNaN
1013SNEA.SG01RAC02B01A01Gross Domestic Product - production measureAgriculture, Forestry and FishingNaN
\n", "
" ], "text/plain": [ " Series_reference GDP_measure \\\n", "0 SNEA.SG00NAC00B15 Gross Domestic Product - expenditure measure \n", "171 SNEA.SG00NAC00B21 Gross National Expenditure \n", "342 SNEA.SG00RAC00B01 Gross Domestic Product - production measure \n", "507 SNEA.SG00RAC00B06 Disposable Income - gross \n", "1013 SNEA.SG01RAC02B01A01 Gross Domestic Product - production measure \n", "\n", " Industry Sector \n", "0 NaN NaN \n", "171 NaN NaN \n", "342 NaN NaN \n", "507 NaN NaN \n", "1013 Agriculture, Forestry and Fishing NaN " ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df3.head()" ] }, { "cell_type": "code", "execution_count": 32, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Series_title_2
0NaN
1013Agriculture, Forestry and Fishing
1178Mining
1343Primary Industries
1508Manufacturing
1673Electricity, Gas, Water and Waste Services
1838Construction
2003Food Manufacturing
2044Manufacturing (excluding Food Manufacturing)
2075Goods Producing Industries
2240Wholesale trade
2405Retail Trade and Accommodation
2570Transport, Postal and Warehousing
2735Information Media and Telecommunications
2900Financial and Insurance Services
3065Rental, Hiring and Real Estate Services (inclu...
3230Professional, Scientific, Technical, Administr...
3395Public Administration and Safety
3560Education and Training
3725Health Care and Social Assistance
3890Arts, Recreation and Other Services
4055Service Industries
4425Wholesale Trade
4630Rental, Hiring and Real Estate Services
4876Total All Industries
4917Agriculture
4958Forestry and Logging
4999Fishing, Aquaculture and Agriculture, Forestry...
5081Food, Beverage and Tobacco Product Manufacturing
5122Textile, Leather, Clothing and Footwear Manufa...
......
8252Intermediate goods - industrial supplies nes -...
8280Intermediate goods - fuels and lubricants - pr...
8308Intermediate goods - fuels and lubricants - pr...
8336Intermediate goods - parts and accessories of ...
8364Intermediate goods - Total
8392Consumption goods - food and beverages, mainly...
8420Consumption goods - food and beverages, mainly...
8448Consumption goods - transport equipment, non-i...
8476Consumption goods - consumer goods nes - durab...
8504Consumption goods - consumer goods nes - semi-...
8532Consumption goods - consumer goods nes - non-d...
8560Consumption goods - Total
8588Passenger motor cars. BEC 51
8616Petrol and avgas. BEC 321
8644Military and other goods. BEC 7
8672General Government
8704Private Non Profit Organisations Serving House...
8736Households
8768Private Non Profit Organisations and Household...
8800Central Government
8832Local Government
10018Total Expenditure by Households in New Zealand
10668Consumption goods - Low value goods purchased ...
14604Per Capita in New Zealand dollars
16030Percentage change from same period previous year
22851Tradeable direct
22979Non-tradeable direct
23107Tradeable Indirect
23235Non-tradeable Indirect
23615Percentage change from previous period
\n", "

126 rows × 1 columns

\n", "
" ], "text/plain": [ " Series_title_2\n", "0 NaN\n", "1013 Agriculture, Forestry and Fishing\n", "1178 Mining\n", "1343 Primary Industries\n", "1508 Manufacturing\n", "1673 Electricity, Gas, Water and Waste Services\n", "1838 Construction\n", "2003 Food Manufacturing\n", "2044 Manufacturing (excluding Food Manufacturing)\n", "2075 Goods Producing Industries\n", "2240 Wholesale trade\n", "2405 Retail Trade and Accommodation\n", "2570 Transport, Postal and Warehousing\n", "2735 Information Media and Telecommunications\n", "2900 Financial and Insurance Services\n", "3065 Rental, Hiring and Real Estate Services (inclu...\n", "3230 Professional, Scientific, Technical, Administr...\n", "3395 Public Administration and Safety\n", "3560 Education and Training\n", "3725 Health Care and Social Assistance\n", "3890 Arts, Recreation and Other Services\n", "4055 Service Industries\n", "4425 Wholesale Trade\n", "4630 Rental, Hiring and Real Estate Services\n", "4876 Total All Industries\n", "4917 Agriculture\n", "4958 Forestry and Logging\n", "4999 Fishing, Aquaculture and Agriculture, Forestry...\n", "5081 Food, Beverage and Tobacco Product Manufacturing\n", "5122 Textile, Leather, Clothing and Footwear Manufa...\n", "... ...\n", "8252 Intermediate goods - industrial supplies nes -...\n", "8280 Intermediate goods - fuels and lubricants - pr...\n", "8308 Intermediate goods - fuels and lubricants - pr...\n", "8336 Intermediate goods - parts and accessories of ...\n", "8364 Intermediate goods - Total\n", "8392 Consumption goods - food and beverages, mainly...\n", "8420 Consumption goods - food and beverages, mainly...\n", "8448 Consumption goods - transport equipment, non-i...\n", "8476 Consumption goods - consumer goods nes - durab...\n", "8504 Consumption goods - consumer goods nes - semi-...\n", "8532 Consumption goods - consumer goods nes - non-d...\n", "8560 Consumption goods - Total\n", "8588 Passenger motor cars. BEC 51\n", "8616 Petrol and avgas. BEC 321\n", "8644 Military and other goods. BEC 7\n", "8672 General Government\n", "8704 Private Non Profit Organisations Serving House...\n", "8736 Households\n", "8768 Private Non Profit Organisations and Household...\n", "8800 Central Government\n", "8832 Local Government\n", "10018 Total Expenditure by Households in New Zealand\n", "10668 Consumption goods - Low value goods purchased ...\n", "14604 Per Capita in New Zealand dollars\n", "16030 Percentage change from same period previous year\n", "22851 Tradeable direct\n", "22979 Non-tradeable direct\n", "23107 Tradeable Indirect\n", "23235 Non-tradeable Indirect\n", "23615 Percentage change from previous period\n", "\n", "[126 rows x 1 columns]" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1[['Series_title_2']].drop_duplicates('Series_title_2')" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "scrolled": false }, "outputs": [], "source": [ "pvt1=pd.pivot_table(df1, values='Data_value', index=['Subject','Series_title_1', 'Series_title_2', 'Period'])" ] }, { "cell_type": "code", "execution_count": 31, "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", "
Data_value
SubjectSeries_title_1Series_title_2Period
National Accounts - SNA 2008 - SNEChanges in InventoriesAgriculture1987.06-125.250000
1987.09108.500000
1987.12175.250000
1988.0344.833333
1988.06-124.000000
\n", "
" ], "text/plain": [ " Data_value\n", "Subject Series_title_1 Series_title_2 Period \n", "National Accounts - SNA 2008 - SNE Changes in Inventories Agriculture 1987.06 -125.250000\n", " 1987.09 108.500000\n", " 1987.12 175.250000\n", " 1988.03 44.833333\n", " 1988.06 -124.000000" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pvt1.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "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.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }