Annual Consumer Price Index

JohnSnowLabs

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

Data Files

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

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.

Import into your tool

Data-cli or just data is the program to get and post your data with the datahub.
Use data with the datahub.io almost like you use git with the github. Here are installation instructions.

data get https://datahub.io/JohnSnowLabs/annual-consumer-price-index
tree JohnSnowLabs/annual-consumer-price-index
# Get a list of dataset's resources
curl -L -s https://datahub.io/JohnSnowLabs/annual-consumer-price-index/datapackage.json | grep path

# Get resources

curl -L https://datahub.io/JohnSnowLabs/annual-consumer-price-index/r/0.csv

curl -L https://datahub.io/JohnSnowLabs/annual-consumer-price-index/r/1.zip

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

install.packages("jsonlite", repos="https://cran.rstudio.com/")
library("jsonlite")

json_file <- 'https://datahub.io/JohnSnowLabs/annual-consumer-price-index/datapackage.json'
json_data <- fromJSON(paste(readLines(json_file), collapse=""))

# get list of all resources:
print(json_data$resources$name)

# print all tabular data(if exists any)
for(i in 1:length(json_data$resources$datahub$type)){
  if(json_data$resources$datahub$type[i]=='derived/csv'){
    path_to_file = json_data$resources$path[i]
    data <- read.csv(url(path_to_file))
    print(data)
  }
}

Note: You might need to run the script with root permissions if you are running on Linux machine

Install the Frictionless Data data package library and the pandas itself:

pip install datapackage
pip install pandas

Now you can use the datapackage in the Pandas:

import datapackage
import pandas as pd

data_url = 'https://datahub.io/JohnSnowLabs/annual-consumer-price-index/datapackage.json'

# to load Data Package into storage
package = datapackage.Package(data_url)

# to load only tabular data
resources = package.resources
for resource in resources:
    if resource.tabular:
        data = pd.read_csv(resource.descriptor['path'])
        print (data)

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('https://datahub.io/JohnSnowLabs/annual-consumer-price-index/datapackage.json')

# print list of all resources:
print(package.resource_names)

# print processed tabular data (if exists any)
for resource in package.resources:
    if resource.descriptor['datahub']['type'] == 'derived/csv':
        print(resource.read())

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 = 'https://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 list of all resources:
  for (const id in dataset.resources) {
    console.log(dataset.resources[id]._descriptor.name)
  }
  // get all tabular data(if exists any)
  for (const id in dataset.resources) {
    if (dataset.resources[id]._descriptor.format === "csv") {
      const file = dataset.resources[id]
      // Get a raw stream
      const stream = await file.stream()
      // entire file as a buffer (be careful with large files!)
      const buffer = await file.buffer
      // print data
      stream.pipe(process.stdout)
    }
  }
})()
Datapackage.json