Skip to content

plpxsk/ranking-countries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ranking the World's Countries (working)

The web app is at:

The inspiration was:

The data is from:

See below for details and tech stack

Details

Similar countries to your top choice are found using machine learning (affinity clustering). See the notebook /code/python-explore/affinitypropagation.ipynb

Data explorer fits a best-fit linear regression line.

For Data details, see /data/README.md

Key directories

/heroku

contains the code for the deployed web application

/code

contains code to munge and explore the data [working]

Tech stack

Briefly, this is a Python-Flask web application with a PostgreSQL database and bokeh-driven data explorer, all deployed to Heroku. The web page is styles with Bootstrap. Favicon is my own, created on Paper for iOS and converted with favicon.cc

Python tools

Graphics

  • bokeh
  • D3, via NVD3
  • Shiny

Analysis

  • R
  • Python

Web

  • WTF-Forms for interactive web forms
  • Bootstrap
  • Custom CSS, HTML tweaks (Safari console debugger was very useful!)

Database (deployed remotely to Heroku/AWS):

  • Postgres

Misc

  • virtual env

USNWR - methodology notes

http://www.usnews.com/news/best-countries/articles/methodology

65 country attributes, grouped into:

  • Adventure
  • Citizenship
  • Cultural Influence
  • Entrepreneurship
  • Heritage
  • Movers
  • Open for Business
  • Power
  • Quality of Life

Sources

More on some CPIA indicators:

Resources

Fantastic tutorial for deploying python/flask apps to Heroku (a bit out of date though)

HTML Table styles in flask/pandas:

Flask and forms