Skip to content

The idea of this repo is to give you a very brief introduction to what python can do, and some of the advantages of using python over tools like Excel.

License

Notifications You must be signed in to change notification settings

nhsengland/python-in-an-hour

Repository files navigation

HACA 2024 - Python in an hour

This reposiitory contains code for use in the Health and Care Analytics conference 2024, in the Python in an Hour session.

The idea of this session is to give you a very brief introduction to what python can do, and some of the advantages of using python over tools like Excel.

It's designed to be run in Google Colab: Open In Colab

there is also a second notebook, which shows how to use dtale to explore data

dtale tutorial: Open In Colab


Description

Reproducible Analytical Pipelines can seem quite abstract - so this repo is meant to serve as a real example, that anyone can run, to see RAP in action.

The pipeline uses artificial HES data, which was chosen as it is "like" real data used in our industry, but also freely available.

This example pipeline uses Pandas to handle a data, a commonly used Python library, which will be installed locally in your environment when you go through the "Getting Started" steps below.

The pipeline follows three steps which are common to almost all analytical pipelines:

  1. Getting the data - in this case we download the artificial HES data as a CSV which is saved into folder called 'data_in' on your machine (see the code in src/data_ingestion)
  2. Processing the data - the data is processed using Pandas
  3. Making outputs- the processed data is Is used to make some plots.

Prerequisites

This code requires:

Getting Started

  1. Clone the repository. To learn about what this means, and how to use Git, see the Git guide.
git clone https://github.com/nhsengland/python_colab_tutorial.git
  1. Set up your environment, either using pip or conda. For more information on how to use virtual environments and why they are important,. see the virtual environments guide.

Using pip

If you're using Windows, enter the following commands into the Command Line or Powershell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt

If you're using Linux or MacOS, enter the following commands into the Terminal:

python -m venv .venv
source venv/bin/activate
python -m pip install -r requirements.txt

For Visual Studio Code it is necessary that you change your default interpreter to the virtual environment you just created .venv. To do this use the shortcut Ctrl-Shift-P, search for Python: Select interpreter and select .venv from the list.

Licence

This codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

Any HTML or Markdown documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.

Acknowledgements

About

The idea of this repo is to give you a very brief introduction to what python can do, and some of the advantages of using python over tools like Excel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published