Population Growth

core

Files Size Format Created Updated License Source
11 28MB csv zip 4 months ago
Total Population - Both Sexes. De facto population in a country, area or region as of 1 July of the year indicated. Figures are presented in thousands. Data Data comes from United Nations' Population Division datasets. Total population (both sexes combined) by region, subregion and country, read more
Download

Data Files

population-estimates  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-medium-fertility  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-high-fertility  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-low-fertility  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-zero-migration  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-momentum  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-instant-replacement  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-constant-fertility  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-constant-mortality  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

population-no-change  

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

Field information

Field Name Order Type (Format) Description
region 1 any
year 2 year
population 3 number

Read me

Total Population - Both Sexes. De facto population in a country, area or region as of 1 July of the year indicated. Figures are presented in thousands.

Data

Data comes from United Nations’ Population Division datasets. Total population (both sexes combined) by region, subregion and country, annually for 1950-2100 (thousands). Data is cleaned, normalized, “un-pivoted”, and represented in nice machine readable way in CSV format. Dataset represented here has several resources:

  • Estimates from 1950 - 2015. Original
  • Medium fertility variant, 2015 - 2100
  • High fertility variant, 2015 - 2100
  • Low fertility variant, 2015 - 2100
  • Constant fertility variant, 2015 - 2100
  • Instant replacement fertility variant, 2015 - 2100
  • Momentum fertility variant, 2015 - 2100
  • Zero Migration variant, 2015 - 2100
  • Constant Mortality variant, 2015 - 2100

Processing

  1. You will need python 3.6 and datapackage-pipelines to process the data.
  2. Create pipeline-spec.yaml and copy from below.
  3. run dpp run population-growth
population-growth:
  pipeline:
    -
      run: add_resource
      parameters:
        name: population-estimates
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: ESTIMATES
    -
      run: add_resource
      parameters:
        name: population-medium-fertility
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: MEDIUM VARIANT
    -
      run: add_resource
      parameters:
        name: population-high-fertility
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: HIGH VARIANT
    -
      run: add_resource
      parameters:
        name: population-low-fertility
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: LOW VARIANT
    -
      run: add_resource
      parameters:
        name: population-constant-fertility
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: CONSTANT-FERTILITY
    -
      run: add_resource
      parameters:
        name: population-instant-replacement
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: INSTANT-REPLACEMENT
    -
      run: add_resource
      parameters:
        name: population-momentum
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: MOMENTUM
    -
      run: add_resource
      parameters:
        name: population-zero-migration
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: ZERO-MIGRATION
    -
      run: add_resource
      parameters:
        name: population-constant-mortality
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: CONSTANT-MORTALITY
    -
      run: add_resource
      parameters:
        name: population-no-change
        url: https://esa.un.org/unpd/wpp/DVD/Files/1_Indicators%20(Standard)/EXCEL_FILES/1_Population/WPP2017_POP_F01_1_TOTAL_POPULATION_BOTH_SEXES.xlsx
        format: xlsx
        skip_rows: 17
        headers: [index, variant, region, notes, country-code, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
        sheet: NO CHANGE
    -
      run: stream_remote_resources
    -
      run: delete_fields
      parameters:
        resources:
          - population-estimates
          - population-medium-fertility
          - population-high-fertility
          - population-low-fertility
          - population-zero-migration
          - population-momentum
          - population-instant-replacement
          - population-constant-fertility
          - population-constant-mortality
          - population-no-change
        fields:
          - index
          - variant
          - notes
          - country-code
    -
      run: unpivot
      parameters:
        resources:
          - population-estimates
          - population-medium-fertility
          - population-high-fertility
          - population-low-fertility
          - population-zero-migration
          - population-momentum
          - population-instant-replacement
          - population-constant-fertility
          - population-constant-mortality
          - population-no-change
        extraKeyFields:
          -
            name: year
            type: year
        extraValueField:
          name: population
          type: number
        unpivot:
          -
            name: ([0-9]{4})
            keys:
              year: \1
    -
      run: dump.to_path

Licence

United Nations, Department of Economic and Social Affairs, Population Division (2017). World Population Prospects: The 2017 Revision, DVD Edition.

Import into your tool

Data-cli or just data is the program to get and post your data with the datahub.
Download CLI tool and use it with the datahub almost like you use git with the github:

data get https://datahub.io/core/population-growth-estimates-and-projections
data info core/population-growth-estimates-and-projections
tree core/population-growth-estimates-and-projections
# Get a list of dataset's resources
curl -L -s https://datahub.io/core/population-growth-estimates-and-projections/datapackage.json | grep path

# Get resources

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/0.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/1.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/2.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/3.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/4.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/5.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/6.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/7.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/8.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/9.csv

curl -L https://datahub.io/core/population-growth-estimates-and-projections/r/10.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/core/population-growth-estimates-and-projections/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/core/population-growth-estimates-and-projections/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/core/population-growth-estimates-and-projections/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/core/population-growth-estimates-and-projections/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