GDP by Industry and Country

JohnSnowLabs

Files Size Format Created Updated License Source
2 3MB csv zip 2 weeks ago John Snow Labs Standard License John Snow Labs CIA World Factbook
Download

Data Files

File Description Size Last changed Download Other formats
gdp-by-industry-and-country-csv [csv] 2MB gdp-by-industry-and-country-csv [csv] gdp-by-industry-and-country-csv [json] (5MB)
gdp-by-industry-and-country_zip [zip] Compressed versions of dataset. Includes normalized CSV and JSON data with original data and datapackage.json. 3MB gdp-by-industry-and-country_zip [zip]

gdp-by-industry-and-country-csv  

This is a preview version. There might be more data in the original version.

Field information

Field Name Order Type (Format) Description
Country 1 string GDP Country Name
Currency 2 string
Indicator_Name 3 string Indicator Name with respect to GDP
GDP_Year_1970 4 integer Data of GDP in year 1970
GDP_Year_1971 5 integer Data of GDP in year 1971
GDP_Year_1972 6 integer Data of GDP in year 1972
GDP_Year_1973 7 integer Data of GDP in year 1973
GDP_Year_1974 8 integer Data of GDP in year 1974
GDP_Year_1975 9 integer Data of GDP in year 1975
GDP_Year_1976 10 integer Data of GDP in year 1976
GDP_Year_1977 11 integer Data of GDP in year 1977
GDP_Year_1978 12 integer Data of GDP in year 1978
GDP_Year_1979 13 integer Data of GDP in year 1979
GDP_Year_1980 14 integer Data of GDP in year 1980
GDP_Year_1981 15 integer Data of GDP in year 1981
GDP_Year_1982 16 integer Data of GDP in year 1982
GDP_Year_1983 17 integer Data of GDP in year 1983
GDP_Year_1984 18 integer Data of GDP in year 1984
GDP_Year_1985 19 integer Data of GDP in year 1985
GDP_Year_1986 20 integer Data of GDP in year 1986
GDP_Year_1987 21 integer Data of GDP in year 1987
GDP_Year_1988 22 integer Data of GDP in year 1988
GDP_Year_1989 23 integer Data of GDP in year 1989
GDP_Year_1990 24 integer Data of GDP in year 1990
GDP_Year_1991 25 integer Data of GDP in year 1991
GDP_Year_1992 26 integer Data of GDP in year 1992
GDP_Year_1993 27 integer Data of GDP in year 1993
GDP_Year_1994 28 integer Data of GDP in year 1994
GDP_Year_1995 29 integer Data of GDP in year 1995
GDP_Year_1996 30 integer Data of GDP in year 1996
GDP_Year_1997 31 integer Data of GDP in year 1997
GDP_Year_1998 32 integer Data of GDP in year 1998
GDP_Year_1999 33 integer Data of GDP in year 1999
GDP_Year_2000 34 integer Data of GDP in year 2000
GDP_Year_2001 35 integer Data of GDP in year 2001
GDP_Year_2002 36 integer Data of GDP in year 2002
GDP_Year_2003 37 integer Data of GDP in year 2003
GDP_Year_2004 38 integer Data of GDP in year 2004
GDP_Year_2005 39 integer Data of GDP in year 2005
GDP_Year_2006 40 integer Data of GDP in year 2006
GDP_Year_2007 41 integer Data of GDP in year 2007
GDP_Year_2008 42 integer Data of GDP in year 2008
GDP_Year_2009 43 integer Data of GDP in year 2009
GDP_Year_2010 44 integer Data of GDP in year 2010
GDP_Year_2011 45 integer Data of GDP in year 2011
GDP_Year_2012 46 integer Data of GDP in year 2012
GDP_Year_2013 47 integer Data of GDP in year 2013
GDP_Year_2014 48 integer Data of GDP in year 2014
GDP_Year_2015 49 integer Data of GDP in year 2015

gdp-by-industry-and-country_zip  

This is a preview version. There might be more data in the original version.

Read me

Import into your tool

If you are using R here's how to get the data you want quickly loaded:

install.packages("jsonlite")
library("jsonlite")

json_file <- "http://datahub.io/JohnSnowLabs/gdp-by-industry-and-country/datapackage.json"
json_data <- fromJSON(paste(readLines(json_file), collapse=""))

# access csv file by the index starting from 1
path_to_file = json_data$resources$path[1][1]
data <- read.csv(url(path_to_file))
print(data)

In order to work with Data Packages in Pandas you need to install the Frictionless Data data package library and the pandas extension:

pip install datapackage
pip install jsontableschema-pandas

To get the data run following code:

import datapackage

data_url = "http://datahub.io/JohnSnowLabs/gdp-by-industry-and-country/datapackage.json"

# to load Data Package into storage
storage = datapackage.push_datapackage(data_url, 'pandas')

# data frames available (corresponding to data files in original dataset)
storage.buckets

# you can access datasets inside storage, e.g. the first one:
storage[storage.buckets[0]]

For Python, first install the `datapackage` library (all the datasets on DataHub are Data Packages):

pip install datapackage

To get Data Package into your Python environment, run following code:

from datapackage import Package

package = Package('http://datahub.io/JohnSnowLabs/gdp-by-industry-and-country/datapackage.json')

# get list of resources:
resources = package.descriptor['resources']
resourceList = [resources[x]['name'] for x in range(0, len(resources))]
print(resourceList)

data = package.resources[0].read()
print(data)

If you are using JavaScript, please, follow instructions below:

Install data.js module using npm:

  $ npm install data.js

Once the package is installed, use the following code snippet:

const {Dataset} = require('data.js')

const path = 'http://datahub.io/JohnSnowLabs/gdp-by-industry-and-country/datapackage.json'

// We're using self-invoking function here as we want to use async-await syntax:
(async () => {
  const dataset = await Dataset.load(path)

  // Get the first data file in this dataset
  const file = dataset.resources[0]
  // Get a raw stream
  const stream = await file.stream()
  // entire file as a buffer (be careful with large files!)
  const buffer = await file.buffer
})()

Install the datapackage library created specially for Ruby language using gem:

gem install datapackage

Now get the dataset and read the data:

require 'datapackage'

path = 'http://datahub.io/JohnSnowLabs/gdp-by-industry-and-country/datapackage.json'

package = DataPackage::Package.new(path)
# So package variable contains metadata. You can see it:
puts package

# Read data itself:
resource = package.resources[0]
data = resource.read
puts data
Datapackage.json