Skip to main content

EHR-Functions

What is this?

A library containing useful EHR related functions for use within Python data analysis, especially within Jupyter notebooks.

When utilizing Jupyter notebooks for processing data and training models I found myself copying the same code between notebooks. This code consisted of steps to split my data, create a model, compute some metrics, etc.; and thus the notebooks became very long with little focus on the actual analysis. Therefore, this set of functions were created to allow for a focus on analysis and to abstract away the process of cleaning data and running models.

Installation

pip install ehr-functions

Documentation

The documentation can be found at: https://fdabek1.github.io/ehr-functions/

Example

from ehr_functions.features import demographics
import pandas as pd 

df = pd.DataFrame({
    'PatientID': [1, 2, 3, 4],
    'PatientAge': [21, 35, 27, 24],
    'PatientGender': ['M', 'F', 'M', 'F'],
    'PatientCategory': ['A', 'B', 'C', 'A'],
})

dems = demographics.get_features(df)
print(dems.head())
PatientID PatientAge PatientGender PatientCategory_A PatientCategory_B PatientCategory_C
1 21 1 1 0 0
2 35 0 0 1 0
3 27 1 0 0 1
4 24 0 1 0 0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ehr-functions-0.2.3.tar.gz (27.5 kB view details)

Uploaded Source

File details

Details for the file ehr-functions-0.2.3.tar.gz.

File metadata

  • Download URL: ehr-functions-0.2.3.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.1

File hashes

Hashes for ehr-functions-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a2cbb356cf503e429024096cdeabc38d4380eeb2ae91aa772fe5cdf2362297f1
MD5 ec7c5082b6304058f2c56ff5f2d83f36
BLAKE2b-256 ab5992bd9bf283613015352cb92a390f977961cbd249ff3d56d68d78c5d55027

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 file

0.2.2

1 file

0.2.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page