Coder Social home page Coder Social logo

nomis-visualisation's Introduction

nomis-visualisation

This project visualizes the UK at district, unitary, or country levels using UK shapefiles from opendatasoft and UK measurements from nomisr API. Extract and manipulate the data and plot UK maps using Python geopandas.

Prerequisites

For pipeline replication, as an example, only Python installation is needed. All extracted data are available in the cloud storage directory

  1. Clone the Repository: Clone the project repository to your local machine using Git:

    git clone https://github.com/KyriakosJiannis/nomis-visualisation
  2. Navigate to the Project Directory: Move to the project directory:

    cd nomis-visualisation
  3. Activate your virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  4. Install the required packages:

    pip install -r requirements.txt
  5. Run the Python pipeline script:

    python ./pipelne/pipeline.py

Project Structure

root/
├── config/
│   └── config.ini
├── input/
│   └── data.txt
├── notebooks/
│   └── nomis_analysis.ipynb
├── output/
│   │   ├── religions_plot_bar1.png
│   │   └── religions_plot_bar2.png
├── pipeline/
│   ├── __init__.py
│   └── run_pipeline.py
├── src/
│   ├── __init__.py
│   ├── analysis/
│   │   ├── __init__.py
│   │   └── analysis_module.py
│   ├── R_scripts/
│   │   └── get_data_nomis.R
├── utils/
│   └── __init__.py
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt

Usage

Provide examples and instructions on how to use the plot_nomis_data function. Include code snippets and explanations for different scenarios with more details in nomis_analysis.ipynb.

Example 1: Religion Census UK

plot_nomis_data(
            geo_data=subset_df,
            cmap="winter",
            title="Population reporting Christian 2011, \n England and Wales local and unitary authorities (%)"
)

Output:

Screenshot

Example 2: Sub-selection of Selected Counties

# Sub-selection of selected counties; this example uses Northamptonshire and its neighbors' area
counties = ['Northamptonshire', 'Central Bedfordshire', 'Milton Keynes', 'Bedford', 'Leicestershire', 'Leicester','Rutland', 'Peterborough', 'Cambridgeshire', 'Oxfordshire', 'Buckinghamshire', 'Warwickshire']

plot_nomis_data(
            geo_data=subset_df[subset_df['county'].isin(counties)],
            cmap="winter",
            title="Population reporting Christian 2011, \n Northamptonshire and neighbours (%)",
            barchart="On"
)

Output:

Screenshot

Development

The next step is to create a web app for religion. Utilise opendatasoft API or/and R (nomisR) and Python pipelines for more versatile and comprehensive extractions beyond religions, and perform analysis using both programming languages.

License

This project is licensed under the MIT License.

nomis-visualisation's People

Contributors

kyriakosjiannis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.