Population Figures By Country

JohnSnowLabs

Files Size Format Created Updated License Source
2 1MB 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
population-figures-by-country-csv [csv] 127kB population-figures-by-country-csv [csv] population-figures-by-country-csv [json] (479kB)
population-figures-by-country_zip [zip] Compressed versions of dataset. Includes normalized CSV and JSON data with original data and datapackage.json. 229kB population-figures-by-country_zip [zip]

population-figures-by-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_Name 1 string Name of the country
Country_Code 2 string Code assigned to the country by the World Bank.
Population_in_1960 3 integer Population of the country in 1960
Population_in_1961 4 integer Population of the country in 1961
Population_in_1962 5 integer Population of the country in 1962
Population_in_1963 6 integer Population of the country in 1963
Population_in_1964 7 integer Population of the country in 1964
Population_in_1965 8 integer Population of the country in 1965
Population_in_1966 9 integer Population of the country in 1966
Population_in_1967 10 integer Population of the country in 1967
Population_in_1968 11 integer Population of the country in 1968
Population_in_1969 12 integer Population of the country in 1969
Population_in_1970 13 integer Population of the country in 1970
Population_in_1971 14 integer Population of the country in 1971
Population_in_1972 15 integer Population of the country in 1972
Population_in_1973 16 integer Population of the country in 1973
Population_in_1974 17 integer Population of the country in 1974
Population_in_1975 18 integer Population of the country in 1975
Population_in_1976 19 integer Population of the country in 1976
Population_in_1977 20 integer Population of the country in 1977
Population_in_1978 21 integer Population of the country in 1978
Population_in_1979 22 integer Population of the country in 1979
Population_in_1980 23 integer Population of the country in 1980
Population_in_1981 24 integer Population of the country in 1981
Population_in_1982 25 integer Population of the country in 1982
Population_in_1983 26 integer Population of the country in 1983
Population_in_1984 27 integer Population of the country in 1984
Population_in_1985 28 integer Population of the country in 1985
Population_in_1986 29 integer Population of the country in 1986
Population_in_1987 30 integer Population of the country in 1987
Population_in_1988 31 integer Population of the country in 1988
Population_in_1989 32 integer Population of the country in 1989
Population_in_1990 33 integer Population of the country in 1990
Population_in_1991 34 integer Population of the country in 1991
Population_in_1992 35 integer Population of the country in 1992
Population_in_1993 36 integer Population of the country in 1993
Population_in_1994 37 integer Population of the country in 1994
Population_in_1995 38 integer Population of the country in 1995
Population_in_1996 39 integer Population of the country in 1996
Population_in_1997 40 integer Population of the country in 1997
Population_in_1998 41 integer Population of the country in 1998
Population_in_1999 42 integer Population of the country in 1999
Population_in_2000 43 integer Population of the country in 2000
Population_in_2001 44 integer Population of the country in 2001
Population_in_2002 45 number Population of the country in 2002
Population_in_2003 46 number Population of the country in 2003
Population_in_2004 47 number Population of the country in 2004
Population_in_2005 48 number Population of the country in 2005
Population_in_2006 49 number Population of the country in 2006
Population_in_2007 50 number Population of the country in 2007
Population_in_2008 51 number Population of the country in 2008
Population_in_2009 52 number Population of the country in 2009
Population_in_2010 53 number Population of the country in 2010
Population_in_2011 54 number Population of the country in 2011
Population_in_2012 55 number Population of the country in 2012
Population_in_2013 56 number Population of the country in 2013
Population_in_2014 57 number Population of the country in 2014
Population_in_2015 58 number Population of the country in 2015
Population_in_2016 59 integer Population of the country in 2016

population-figures-by-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/population-figures-by-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/population-figures-by-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/population-figures-by-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/population-figures-by-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/population-figures-by-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