Files | Size | Format | Created | Updated | License | Source |
---|---|---|---|---|---|---|
2 | 957kB | csv zip | 3 years ago | 2 years ago | John Snow Labs Standard License | John Snow Labs The World Bank |
Download files in this dataset
File | Description | Size | Last changed | Download |
---|---|---|---|---|
population-figures-by-country-csv | 126kB | csv (126kB) , json (346kB) | ||
population-figures-by-country_zip | Compressed versions of dataset. Includes normalized CSV and JSON data with original data and datapackage.json. | 224kB | zip (224kB) |
This is a preview version. There might be more data in the original version.
Field Name | Order | Type (Format) | Description |
---|---|---|---|
Country | 1 | string | Name of the country |
Country_Code | 2 | string | Code assigned to the country by the World Bank. |
Year_1960 | 3 | integer | Population of the country in 1960 |
Year_1961 | 4 | integer | Population of the country in 1961 |
Year_1962 | 5 | integer | Population of the country in 1962 |
Year_1963 | 6 | integer | Population of the country in 1963 |
Year_1964 | 7 | integer | Population of the country in 1964 |
Year_1965 | 8 | integer | Population of the country in 1965 |
Year_1966 | 9 | integer | Population of the country in 1966 |
Year_1967 | 10 | integer | Population of the country in 1967 |
Year_1968 | 11 | integer | Population of the country in 1968 |
Year_1969 | 12 | integer | Population of the country in 1969 |
Year_1970 | 13 | integer | Population of the country in 1970 |
Year_1971 | 14 | integer | Population of the country in 1971 |
Year_1972 | 15 | integer | Population of the country in 1972 |
Year_1973 | 16 | integer | Population of the country in 1973 |
Year_1974 | 17 | integer | Population of the country in 1974 |
Year_1975 | 18 | integer | Population of the country in 1975 |
Year_1976 | 19 | integer | Population of the country in 1976 |
Year_1977 | 20 | integer | Population of the country in 1977 |
Year_1978 | 21 | integer | Population of the country in 1978 |
Year_1979 | 22 | integer | Population of the country in 1979 |
Year_1980 | 23 | integer | Population of the country in 1980 |
Year_1981 | 24 | integer | Population of the country in 1981 |
Year_1982 | 25 | integer | Population of the country in 1982 |
Year_1983 | 26 | integer | Population of the country in 1983 |
Year_1984 | 27 | integer | Population of the country in 1984 |
Year_1985 | 28 | integer | Population of the country in 1985 |
Year_1986 | 29 | integer | Population of the country in 1986 |
Year_1987 | 30 | integer | Population of the country in 1987 |
Year_1988 | 31 | integer | Population of the country in 1988 |
Year_1989 | 32 | integer | Population of the country in 1989 |
Year_1990 | 33 | integer | Population of the country in 1990 |
Year_1991 | 34 | integer | Population of the country in 1991 |
Year_1992 | 35 | integer | Population of the country in 1992 |
Year_1993 | 36 | integer | Population of the country in 1993 |
Year_1994 | 37 | integer | Population of the country in 1994 |
Year_1995 | 38 | integer | Population of the country in 1995 |
Year_1996 | 39 | integer | Population of the country in 1996 |
Year_1997 | 40 | integer | Population of the country in 1997 |
Year_1998 | 41 | integer | Population of the country in 1998 |
Year_1999 | 42 | integer | Population of the country in 1999 |
Year_2000 | 43 | integer | Population of the country in 2000 |
Year_2001 | 44 | integer | Population of the country in 2001 |
Year_2002 | 45 | number | Population of the country in 2002 |
Year_2003 | 46 | number | Population of the country in 2003 |
Year_2004 | 47 | number | Population of the country in 2004 |
Year_2005 | 48 | number | Population of the country in 2005 |
Year_2006 | 49 | number | Population of the country in 2006 |
Year_2007 | 50 | number | Population of the country in 2007 |
Year_2008 | 51 | number | Population of the country in 2008 |
Year_2009 | 52 | number | Population of the country in 2009 |
Year_2010 | 53 | number | Population of the country in 2010 |
Year_2011 | 54 | number | Population of the country in 2011 |
Year_2012 | 55 | number | Population of the country in 2012 |
Year_2013 | 56 | number | Population of the country in 2013 |
Year_2014 | 57 | number | Population of the country in 2014 |
Year_2015 | 58 | number | Population of the country in 2015 |
Year_2016 | 59 | integer | Population of the country in 2016 |
Use our data-cli tool designed for data wranglers:
data get https://datahub.io/JohnSnowLabs/population-figures-by-country
data info JohnSnowLabs/population-figures-by-country
tree JohnSnowLabs/population-figures-by-country
# Get a list of dataset's resources
curl -L -s https://datahub.io/JohnSnowLabs/population-figures-by-country/datapackage.json | grep path
# Get resources
curl -L https://datahub.io/JohnSnowLabs/population-figures-by-country/r/0.csv
curl -L https://datahub.io/JohnSnowLabs/population-figures-by-country/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/population-figures-by-country/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/population-figures-by-country/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/population-figures-by-country/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/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 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)
}
}
})()