Annual Consumer Price Index

JohnSnowLabs

Files Size Format Created Updated License Source
2 771kB csv zip 2 weeks ago John Snow Labs Standard License John Snow Labs The World Bank
Download

Data Files

File Description Size Last changed Download Other formats
annual-consumer-price-index-csv [csv] 97kB annual-consumer-price-index-csv [csv] annual-consumer-price-index-csv [json] (349kB)
annual-consumer-price-index_zip [zip] Compressed versions of dataset. Includes normalized CSV and JSON data with original data and datapackage.json. 162kB annual-consumer-price-index_zip [zip]

annual-consumer-price-index-csv  

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

Field information

Field Name Order Type (Format) Description
Country_Name 1 string Refers to the Name of the Country for which the Annual Consumer Price Index (CPI) is calculated.
Country_Code 2 string Indicates the Codes for different countries.
Year_1960 3 string The CPI value for year 1960 for different countries.
Year_1961 4 string The CPI value for year 1961 for different countries.
Year_1962 5 string The CPI value for year 1962 for different countries.
Year_1963 6 string The CPI value for year 1963 for different countries.
Year_1964 7 string The CPI value for year 1964 for different countries.
Year_1965 8 string The CPI value for year 1965 for different countries.
Year_1966 9 string The CPI value for year 1966 for different countries.
Year_1967 10 string The CPI value for year 1967 for different countries.
Year_1968 11 string The CPI value for year 1968 for different countries.
Year_1969 12 string The CPI value for year 1969 for different countries.
Year_1970 13 string The CPI value for year 1970 for different countries.
Year_1971 14 string The CPI value for year 1971 for different countries.
Year_1972 15 string The CPI value for year 1972 for different countries.
Year_1973 16 string The CPI value for year 1973 for different countries.
Year_1974 17 string The CPI value for year 1974 for different countries.
Year_1975 18 string The CPI value for year 1975 for different countries.
Year_1976 19 string The CPI value for year 1976 for different countries.
Year_1977 20 string The CPI value for year 1977 for different countries.
Year_1978 21 string The CPI value for year 1978 for different countries.
Year_1979 22 string The CPI value for year 1979 for different countries.
Year_1980 23 string The CPI value for year 1980 for different countries.
Year_1981 24 string The CPI value for year 1981 for different countries.
Year_1982 25 string The CPI value for year 1982 for different countries.
Year_1983 26 string The CPI value for year 1983 for different countries.
Year_1984 27 string The CPI value for year 1984 for different countries.
Year_1985 28 string The CPI value for year 1985 for different countries.
Year_1986 29 string The CPI value for year 1986 for different countries.
Year_1987 30 string The CPI value for year 1987 for different countries.
Year_1988 31 string The CPI value for year 1988 for different countries.
Year_1989 32 string The CPI value for year 1989 for different countries.
Year_1990 33 string The CPI value for year 1990 for different countries.
Year_1991 34 string The CPI value for year 1991 for different countries.
Year_1992 35 string The CPI value for year 1992 for different countries.
Year_1993 36 string The CPI value for year 1993 for different countries.
Year_1994 37 number The CPI value for year 1994 for different countries.
Year_1995 38 number The CPI value for year 1995 for different countries.
Year_1996 39 number The CPI value for year 1996 for different countries.
Year_1997 40 number The CPI value for year 1997 for different countries.
Year_1998 41 number The CPI value for year 1998 for different countries.
Year_1999 42 number The CPI value for year 1999 for different countries.
Year_2000 43 number The CPI value for year 2000 for different countries.
Year_2001 44 number The CPI value for year 2001 for different countries.
Year_2002 45 number The CPI value for year 2002 for different countries.
Year_2003 46 number The CPI value for year 2003 for different countries.
Year_2004 47 number The CPI value for year 2004 for different countries.
Year_2005 48 number The CPI value for year 2005 for different countries.
Year_2006 49 number The CPI value for year 2006 for different countries.
Year_2007 50 number The CPI value for year 2007 for different countries.
Year_2008 51 number The CPI value for year 2008 for different countries.
Year_2009 52 number The CPI value for year 2009 for different countries.
Year_2010 53 number The CPI value for year 2010 for different countries.
Year_2011 54 number The CPI value for year 1996 for different countries.
Year_2012 55 number The CPI value for year 2012 for different countries.
Year_2013 56 number The CPI value for year 2013 for different countries.
Year_2014 57 number The CPI value for year 2014 for different countries.
Year_2015 58 number The CPI value for year 2015 for different countries.
Year_2016 59 number The CPI value for year 2016 for different countries.

annual-consumer-price-index_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/annual-consumer-price-index/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/annual-consumer-price-index/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/annual-consumer-price-index/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/annual-consumer-price-index/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/annual-consumer-price-index/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